procmail
[Top] [All Lists]

Re: testing for existence of a file without a fork

2002-05-02 17:47:52
When I said,

... but unfortunately on the system in question touch -c always
returns success whether the file exists or not.

Andrew replied,

| Interesting. What system are you doing this on? touch -c
nonexistant-filename
| on both Linux and Solaris return a non-zero exit status. Only other system
I
| have available to me to test is Irix, which is powered down right now.

There are some servers on it where touch -c exits 1 if the file doesn't
exist, but incoming mail delivery processes happen on one where it exits 0.
I don't know the names of the OSes; uname -a doesn't say anything
informative.

On another provider running NetBSD, touch -c also exits 0 if the file doesn't
exist.  I'm guessing that it would exit non-zero only when the file exists
but the user lacks permission to modify the inode.

I wonder what would happen, though it would be of no use to me, if the file
didn't exist but the name lay in a directory where the user had no write
permission.  Probably also an exit of 0, since touch -c wouldn't attempt to
create a file.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail