Vincent Lefevre wrote: > The 'touch' documentation (info manual, man page and 'touch --help' > output) needs to be clarified. > > 1. First, 'touch' follows symbolic links, and the documentation should > say that, because this is far from being clear (e.g. 'rm' and 'ls' > don't follow symbolic links). I suppose that this is the correct > behavior, though POSIX isn't clear either, as BSD 'touch' does the > same thing.
I am sorry that you are frustrated by the way symbolic links operate within BSD derived systems. Symlinks create a fundamental operating interface between all programs and the filesystem. They permeate everything that operates on files in a fundamental way. Because they are a very low level interface I don't believe it is possible nor appropriate to note how symlinks affect everything everywhere. The best that can be done is to learn how they affect the filesystem interface and apply that model to all applications that operate on the filesystem. The touch command follows symlinks because generally everything follows symlinks. The commands that do not follow symlinks are the exceptions to that rule. The rm command is not an exception here because rm operates on symbolic links normally. The ls command is an exception and where it handles symlinks specially is documented. Because 'touch' does not do anything special with regards to symbolic links I do not think it needs any exceptions listed for them. That is, if touch mentioned symlinks then every command should mention symlinks and that would be too much. But because touch behaves normally in this area I believe touch should not mention symlinks and should be taken as operating normally on files. All file operations follow symlinks by default. Only when this is not the case should this be mentioned. The 'ls', 'chown', etc. commands has special options for dealing with symlinks and those are mentioned specifically there. Symbolic links were added to BSD and later ported to System V well before being standardized by POSIX. Since symlinks originated in BSD there is a strong weight toward BSD behavior with regards to the behavior surrounding symlinks. > 2. The info manual says in Section 13.4 (about 'touch'): It also says this following. This is important and related to the discussion. touch [OPTION]... FILE... > Any FILE that does not exist is created empty. > > A FILE of `-' causes `touch' to change the times of the file > associated with standard output. Yes. > In the first sentence, 'FILE' refers to a file (after following > dereferencing symbolic links). Actually FILE in the above refers to the use of FILE as a command line argument to the touch command as noted in the synopsis. It could say the following not using FILE and also be correct: touch [OPTION]... FOO... Any FOO that does not exist is created empty. A FOO of `-' causes `touch' to change the times of the file associated with standard output. > In the second sentence, 'FILE' refers to a string ('-' being > different from './-' for instance). I suggest saying something > like: > > An operand of `-' ... > > or > > A FILE string of `-' ... I could suggest the following: touch [OPTION]... FILE... Any FILE argument that does not exist is created empty. A FILE argument string of `-' is handled specially and causes `touch' to change the times of the file associated with standard output. Bob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]