bug-coreutils
[Top][All Lists]
Advanced

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

Re: chmod 0755 behaves like chmod 755


From: Mike Frysinger
Subject: Re: chmod 0755 behaves like chmod 755
Date: Wed, 3 Oct 2007 23:58:00 -0400
User-agent: KMail/1.9.7

On Wednesday 03 October 2007, Paul Eggert wrote:
> Jason Pepas <address@hidden> writes:
> > was there a reason for this?  I hardly think someone would put a
> > leading octal 0 in by mistake...
>
> This came up in previous discussion, and the consensus at the time is
> that leading zeros should not matter, just as they don't matter in
> ordinary numeric representation.  Other implementations disagree with
> each other on this matter.  Obviously there is no standard in this
> area, so portable scripts shouldn't rely on any particular behavior
> for "0755".

well, it is and it isnt ... POSIX is clear on the behavior with files, but 
says that it's up to specific implementations how they behave on 
directories ... it seems inconsistent to me that doing:
chmod 0755 file
behaves differently than:
chmod 0755 directory
yes, POSIX allows this, but it's hard to swallow the "leading zeros are 
irrelevant" logic when it gets qualified according to POSIX and becomes "when 
working on a file, leading zeros are significant, but when working on 
anything else, leading zeros are insignificant"
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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