avoiding file corruption

Bryan Olson fakeaddress at nowhere.org
Sun Aug 27 11:10:04 EDT 2006


Grant Edwards wrote:
> Amir  Michail wrote:
> 
>> Trying to open a file for writing that is already open for writing
>> should result in an exception.
> 
> MS Windows seems to do something similar, and it pisses me off
> no end.  Trying to open a file and read it while somebody else
> has it open for writing causes an exception.  If I want to open
> a file and read it while it's being writtent to, that's my
> business. 

Windows is actually much more sophisticated. It does allows shared
write access; see the FILE_SHARE_WRITE option for Win32's CreateFile.
You can also lock specific byte ranges in a file.


-- 
--Bryan



More information about the Python-list mailing list