Re: How to remove a single line from a flat file
- From: "Larry W. Virden" <lvirden@xxxxxxxxx>
- Date: 18 May 2007 04:56:36 -0700
On May 18, 7:10 am, Neil Madden <n...@xxxxxxxxxxxxx> wrote:
I think you are contradicted by the quoted history of this thread (above):
Now, now, no need to argue over what I thought or meant. I'm sitting
right here - feel free to ask me, in private or public, what I meant.
I'll try, yet again, to explain.
There are several states that critical files (like passwords or other
types of access control or resource listing files) can be in.
1. Fully existent. Think a quiet period when no changes are occurring
to the list of users and passwords.
2. Not present - in some of the previous discussions, this would be
the case if one did the move of password to some temporary name.
3. Incomplete - again, this would be the case from the earlier
examples, where one moved the file and then rewrote it.
4. Inconsistent - this state applies to the last example, where one
creates a temporary file then does a move of the temporary file to the
authority file. So, how can there be inconsistent state here? Let's
play "imagine this"...
Application 1 opens a file and starts reading through, looking for
information.
Application 2 creates a temporary file, consisting of new,
replacement, or remaining records after a deletion.
Application 1 continues reading
Application 2 completes the creation of the replacement file and does
the move.
Application 1 is reading a file that doesn't exist any longer,
essentially. I don't believe that it is going to see the new file - it
didn't open it. So it is only going to see what was in the original
file, which must be in cache or something.
This is where it would really be useful to have fully functional file
locking, so that at the time of opening a file, one opens it with
locking that says "someone is reading this file" or "someone is
writing this file". If someone is writing the file at the time someone
wants to read it, then likely one would wait. If someone is reading
the file at the time someone else is reading it, no problem, let it
happen. If someone is reading the file when someone wants to move the
temporary file into place, then I guess one would wait, or, perhaps,
some sort of "override lock" mechanism might be put into place that
would signal the reader "hey, something has changed - you've lost your
lock, you need to start over somehow ".
J Average Developer is going to look at this thread and say "boy, that
old guy is certainly paranoid". And I say "yup, young whippersnapper.
After programming for developers for 30 years ... and in particular
doing maintenance fixes for most of that time on the same code base,
you'd find you became paranoid as well."
.
- Follow-Ups:
- Re: How to remove a single line from a flat file
- From: Darren New
- Re: How to remove a single line from a flat file
- From: Donal K. Fellows
- Re: How to remove a single line from a flat file
- References:
- How to remove a single line from a flat file
- From: Swaroop
- Re: How to remove a single line from a flat file
- From: Larry W. Virden
- Re: How to remove a single line from a flat file
- From: suchenwi
- Re: How to remove a single line from a flat file
- From: Larry W. Virden
- Re: How to remove a single line from a flat file
- From: slebetman@xxxxxxxxx
- Re: How to remove a single line from a flat file
- From: Larry W. Virden
- Re: How to remove a single line from a flat file
- From: slebetman@xxxxxxxxx
- Re: How to remove a single line from a flat file
- From: Neil Madden
- Re: How to remove a single line from a flat file
- From: slebetman@xxxxxxxxx
- Re: How to remove a single line from a flat file
- From: Neil Madden
- How to remove a single line from a flat file
- Prev by Date: Re: How to remove a single line from a flat file
- Next by Date: Re: Cross platform compression libraries.
- Previous by thread: Re: How to remove a single line from a flat file
- Next by thread: Re: How to remove a single line from a flat file
- Index(es):
Relevant Pages
|