|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Flat File Editing Questionby 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.
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.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||