safe simultaneous file append?

piet at piet at
Mon Oct 8 12:02:52 CEST 2001

>>>>> Dale Strickland-Clark <dale at> (DS) writes:

DS> Yes. You can't append to a file from two different places at once. You
DS> have a few choices:

In fact in modern Unixes you *CAN*.
>From man fopen:

     Opening a file with append mode (a as the first character in
     the  mode argument) causes all subsequent writes to the file
     to be forced to the then current end-of-file, regardless  of
     intervening  calls  to fseek(3S).  If two separate processes
     open the same file for append, each process may write freely
     to  the file without fear of destroying output being written
     by the other.  The output from the  two  processes  will  be
     intermixed in the file in the order in which it is written.

Piet van Oostrum <piet at>
Private email: P.van.Oostrum at

More information about the Python-list mailing list