Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
The stupid question is the question not asked
 
PerlMonks  

Re: Flat File Editing Question

by jorg (Friar)
on May 24, 2001 at 00:10 UTC ( [id://82778]=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 Flat File Editing Question

The issue you have with concurrent updates is one you'll always have : last update overwrites previous one. This is true whether you're using a flat file or a database.
So for data integrity you would need to feedback to the user if the file was updated between him viewing it on the webpage and updating it.

As far as system integrity concerns : you're opening the file twice, the read will get screwed up if another thread is writing to it. There are ways of editing a file in place so you wouldn't need to open it twice.

Note : I removed the rest of my rant after a supersearch, this topic has been reviewed extensively already in editing/deleting record in flat file database and turnstep even added a nice code snippet that handles concurrent updates.



Jorg

"Do or do not, there is no try" -- Yoda

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://82778]
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.