Le 2011-09-24 18:40, Bob Proulx a écrit :
Filipus Klutiero wrote:
chmod's manual page contains:

chmod  changes the file mode bits of each given file according to
mode, which can be either a symbolic representation of changes to
make, or an octal number representing the bit pattern for the new
mode bits.
An octal number does not necessarily represent the bit pattern for
the new mode bits. If a FILE is a directory, the first digit does
not necessarily represent the bit pattern of its special bits. As
explained in the "SETUID AND SETGID BITS" section:
The change to the way octal file modes are handled is a recent one to
the upstream coreutils.  (One that I argued against making as it
happens.)  It was implemented to make shared work among several users
easier.  It intentionally requires clearing the sgid bit with an
explicit command so that the sgid bit remains behind in the typical
usage.  If people are working with an sgid directory then most of the
time the commands do the right thing.  And if you use the symbolic
modes which are preferred now then there isn't an issue.  I always use
the symbolic modes now.

But being a recent feature addition to the upstream coreutils the
ramifications haven't filtered through everywhere yet.  It will take a
while for all of the parts such as documentation to be corrected.
Interesting...
chmod  changes the file mode bits of each given file according to
mode, which can be either a symbolic representation of changes to
make, or an octal number representing the bit pattern for the new
mode bits.
Therefore, for example, if a directory has mode 2775, running chmod
on it with OCTAL-MODE 0775 does not change its mode [to 0775].
Do you have a suggestion for how this wording may be improved?

Not particularly. I wasn't aware of this change before today, and I spent a couple of hours trying to understand modes and chmod. What is clear is that unless you opt for vagueness, the description has to become more complex. I think there could be a general description, then a subsection for each usage. To avoid confusion, it would help to rename MODE to something that distinguishes from OCTAL-MODE, perhaps SYMBOLIC-MODE-CHANGE. OCTAL-MODE could also become OCTAL-MODE-CHANGE to be exact. Then the subsection on the octal mode would need to distinguish the first digit from the others.



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to