Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
My point is not a typo.
Both "+<$user_name" and "+>$user_name" open the file for both reading and writing, but the first opens it for reading, and you can also write, while the second opens it for writing, but you can also read. Therefore the second wipes out the possibly existing file for you, while the first does not. Wiping out the file before you lock it and ensure it is not in use is unlikely to be desired. I call that, ERACE. (Sorry, didn't even try to hold that one back. :-) If this confuses you, just use sentinel files as in Simple Locking since I already dealt with all of this there.
EDIT
EDIT 2 In reply to RE (tilly) 3: Creating a file with Open
by tilly
|
|