Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

RE (tilly) 3: Creating a file with Open

by tilly (Archbishop)
on Oct 03, 2000 at 18:12 UTC ( #35104=note: print w/replies, xml ) Need Help??


in reply to (Guildenstern) RE: RE (tilly) 1: Creating a file with Open
in thread Creating a file with Open

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
Somehow I said "suggestion" where I meant "typo". Fixed.

EDIT 2
Some days I should not post. Thanks isotope for pointing out I meant "while the first does not". *sigh*

  • Comment on RE (tilly) 3: Creating a file with Open

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://35104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-06-30 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (97 votes). Check out past polls.

    Notices?