[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mkdir -p and -m cannot be used together
From: |
Jon Stanley |
Subject: |
mkdir -p and -m cannot be used together |
Date: |
Fri, 31 Oct 2008 13:20:44 -0400 |
OK, I've never really noticed this before, but it just bit me :)
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:
address@hidden src]# ./mkdir -m 755 -p /tmp/a/b/c
address@hidden src]# ls -lR /tmp/a
/tmp/a:
total 4
drwxrwx--- 3 root root 4096 Oct 31 17:17 b
/tmp/a/b:
total 4
drwxr-xr-x 2 root root 4096 Oct 31 17:17 c
/tmp/a/b/c:
total 0
address@hidden src]#
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 :)
- mkdir -p and -m cannot be used together,
Jon Stanley <=