bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir semantics


From: Paul Eggert
Subject: Re: mkdir semantics
Date: Sun, 03 Jul 2005 03:00:16 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (David Feuer) writes:

> I am working on rewriting mkdir to do smarter fchdir optimization when
> multiple directories are being created.

I assume you're starting from the CVS version of coreutils?
(Just as a warning: the code has changed lately.)

> umask 2
> mkdir -m a+w -p foo/bar foo  (does foo absolutely need to be created
> with permissions according to the umask, or is it acceptable to create
> it with permissions according to the -m argument?)

POSIX requires the former.  See
<http://www.opengroup.org/onlinepubs/000095399/utilities/mkdir.html>.

> mkdir /a
> ln -s /a/c /a/b    (note that this creates a symbolic link into the
> void)
> mkdir /a/c /a/b/x  (can this be allowed to fail with an error?)

POSIX requires that the directories must be created in the order
specified, so I'd say that the last command would have to succeed
(unless I'm missing the point somehow).

> Would a new implementation of mkdir have to behave exactly like the
> current one in such cases, or is the implementation allowed some
> latitude in dealing with them?

There is some latitude, yes.  However, we'd prefer to continue to
conform to POSIX unless there's a good reason to depart from it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]