Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: File locking and Storable

by jpfarmer (Pilgrim)
on Apr 04, 2004 at 20:18 UTC ( [id://342541]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: File locking and Storable
in thread File locking and Storable

I'm not quite sure what while I do all of the reading/writing I need to do means

What I ment was that I need to do more than just read or just write the file, I need to be able to read the file, make changes, then write back. If I lock the conventional way, then I'll open a file handle for read, lock it, release the handle, open a handle for write, lock it, then release the handle. There is a period of time between my two locks where the file could be changed. That means the version of the file in memory would be different then the one on disk (the version in memory would be older).

If I make changes to the version in memory then write out to disk, I'll clobber changes made to the file after I read it into memory. So I need a lock that will let me have exclusive access to the file until I'm done with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342541]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.