in reply to Re: Re: Re: (OT?) File Locking
in thread (OT?) File Locking

I don't know if this [automatic seek to eof when writing a file opened for append] is true in Windows.

It isn't. This is a frequent source of hard-to-track file corruption.

Replies are listed 'Best First'.
(tye)Re: (OT?) File Locking
by tye (Sage) on Apr 14, 2002 at 20:16 UTC

    The automatic seek is there, it is just that the seek and subsequent write are not done as an atomic operation so there is a race condition. Looking at the source code, I see that the translation of "\n" to "\r\n" is done between the seek and the write, so the race condition will probably be noticeably worse if you didn't use binmode.

            - tye (but my friends call me "Tye")