procmail
[Top] [All Lists]

Re: testing for existence of a file without a fork

2002-05-02 20:55:58
in message <20020502163507(_dot_)P11175(_at_)forge(_dot_)godmoma(_dot_)com>,
wrote Andrew Edelstein thusly...

On Thu, May 02, 2002 at 05:49:22PM -0500, David W. Tamkin wrote:
Tried that too, thanks.  Updating the access or mod time of the
file wouldn't cause a problem, but unfortunately on the system
in question touch -c always returns success whether the file
exists or not.

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.

freebsd's "touch -c" is (almost) always successful as an example...


TOUCH(1)                FreeBSD General Commands Manual               TOUCH(1)
...
     -c      Do not create the file if it does not exist.  The touch utility
             does not treat this as an error.  No error messages are displayed
             and the exit value is not affected.


  file          file          dir       "touch -c"
(not) exist   permission    permission      rc
-----------------------------------------------------
  not exist      -            rwx            0
  exist          -            rwx            0
  not exist      -            r-x            0
  exist          r-           r-x            1 ("permission denied" error)
  exist          rw           r-x            0


  - public servant

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