-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jon Stanley on 10/31/2008 11:20 AM:
> Trying to make a directory structure with mode 755, when your umask is
> for example 0007, doesn't produce the desired results for the parent
> directories:
> 
> [EMAIL PROTECTED] src]# ./mkdir -m 755 -p /tmp/a/b/c
> [EMAIL PROTECTED] src]# ls -lR /tmp/a
> drwxrwx--- 3 root root 4096 Oct 31 17:17 b
> drwxr-xr-x 2 root root 4096 Oct 31 17:17 c

> Is there some reason for this? I've verified this in my distros
> coreutils, as well as coreutils-6.9 (above).  I'd think this would be
> a FAQ. but I found no other references to this aberrant behavior
> anywhere :)

Thanks for the report.  However, this behavior is not aberrant.  Rather,
it is mandated by POSIX:

http://www.opengroup.org/onlinepubs/009695399/utilities/mkdir.html

For each dir operand that does not name an existing directory, effects
equivalent to those caused by the following command shall occur:

mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
mkdir [-m mode] dir

where the -m mode option represents that option supplied to the original
invocation of mkdir, if any.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkLULwACgkQ84KuGfSFAYAUWwCcDoXU92w8+dxiLI4LDvrXsVgY
FOYAn0/5ej2t0ar6KuzP8IyKPi4QK93A
=h5w5
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to