in reply to (Guildenstern) RE: RE (tilly) 1: Creating a file with Open
in thread Creating a file with Open
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!)
|
|---|