[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why "atomically" [was [Newbie Question] writing text to file]



on 5/15/2002 7:00 PM, Alexander Reichstadt at pigforce@xxxxxxx wrote:

> My bad, what I wanted to ask was what in fact really happens to the file
> in either situation (atomically YES or NO) and what ends this
> differentiation is meant to serve. I mean, if it is written to an aux
> file, once the writing job is done will I find it at that location or
> not? I sure will, but if this is the case, in turn what sense does it
> make to have the choice to write 'unatomically', or, who would possibly
> want to write corrupted files?
> 
> A situation I can think of but with no means to verify is something like
> streaming, where you might just want to buffer whatever you get and deal
> with the data straight away, and compensate for any integrity issues in
> one go with processing the data instead of leaving such verification to
> read/write routines, and instead of having to wait until all writing is
> done before processing the written information any further. Anyone who
> can shed some more light on that aspect?
> 
> Alex

Well, for one thing, writing atomically means that the original file is
replaced, so aliases break. Plus, writing atomically means that the
destination file is created every time you write instead of only being
modified (so you can never know when the file was originally created).

Someone else will probably give you other possibilities.

Chris