Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Opening the file "+>" will wipe it out, so flocking it
is then pretty pointless - you destroy the file before
you've gained the lock on it.
You need to open the file "+<", if that failed then open it "+>" then flock it then truncate it if you want to be safe with your flocking in the presence of other readers. Note that if you want to read the file back in with flocking you need to use "+<" so that you open the file with write intent otherwise the flocking may not work properly (I don't understand the reasons for this but that is what it says in the man pages!)
In reply to RE: (Guildenstern) RE: RE (tilly) 1: Creating a file with Open
by ncw
|
|