On 2/9/23 4:30 PM, Pádraig Brady wrote:

In this case coreutils tries the mkdir() and handles exceptions.

   if mkdir(d) == EEXIST
     return stat(d) == S_ISDIR

I see the bash example mkdir loadable here:
http://git.savannah.gnu.org/gitweb/?p=bash.git;a=blob;f=examples/loadables/mkdir.c
The final stat/mkdir call looks like the following,
and could possibly be adjusted to the pattern above?

Sure, that's not unreasonable. I'll see what I can do.

Also worth noting that using a mkdir loadable for speed
should be carefully considered, as mkdir isn't a trivial
operation wrt cross platform issues, permissions,
and SELinux contexts etc.

I'm pretty sure the bash loadable implements the POSIX mkdir as specified.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to