procmail
[Top] [All Lists]

Re: testing for existence of a file without a fork

2002-05-02 14:21:50
On Thu, May 02, 2002 at 11:35:55AM -0500, David W. Tamkin wrote:
Failing that, on a system where /bin/test is a shell script, what would you
folks recommend as a small, cheap-to-run fork that (1) can take a filename as
a positional parameter [so that there's no need to fork a shell to handle
"<"], (2) will exit with an error if the file doesn't exist. and (3) will not
read the whole blasted file if it does exist and is long.  The best I can
think of is head -0.

Touch -c? Only drawback I see is that if the file does exist, it will touch
it, which may or may not be an issue for your application.

-- 
Andrew Edelstein        -       http://andrew.pure-chaos.com
"If you're not pissed off at the world then you're just not paying attention."
                                Kasey Chambers "Ignorance"
"If you're not frightened by this, you're simply not paying attention."
                                Harry Browne
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>