Re: [Python] RE: How to safely maintain a status file

2012-07-13 Thread Christian Heimes
Am 13.07.2012 21:57, schrieb MRAB: > It's possible to create a temporary file even in Windows. Windows has a open() flag named O_TEMPORARY for temporary files. With O_TEMPORARY the file is removed from disk as soon as the file handle is closed. On POSIX OS it's common practice to unlink temporary

Re: [Python] RE: How to safely maintain a status file

2012-07-13 Thread MRAB
On 13/07/2012 19:28, Hans Mulder wrote: On 13/07/12 19:59:59, Prasad, Ramit wrote: I lean slightly towards the POSIX handling with the addition that any additional write should throw an error. You are now saving to a file that will not exist the moment you close it and that is probably not expe

Re: [Python] RE: How to safely maintain a status file

2012-07-13 Thread Hans Mulder
On 13/07/12 19:59:59, Prasad, Ramit wrote: > I lean slightly towards the POSIX handling with the addition that > any additional write should throw an error. You are now saving to > a file that will not exist the moment you close it and that is > probably not expected. I'd say: it depends. If t

Re: [Python] RE: How to safely maintain a status file

2012-07-13 Thread Chris Angelico
On Sat, Jul 14, 2012 at 3:59 AM, Prasad, Ramit wrote: > I lean slightly towards the POSIX handling with the addition that > any additional write should throw an error. You are now saving to > a file that will not exist the moment you close it and that is probably > not expected. There are several

RE: [Python] RE: How to safely maintain a status file

2012-07-13 Thread Prasad, Ramit
> >> Well "neat tricks" aside, I am of the firm belief that deleting files > should > >> never be possible whilst they are open. > > This is one of the few instances I think Windows does something better > > than OS X. Windows will check before you attempt to delete (i.e. move > > to Recycling Bin)

Re: [Python] RE: How to safely maintain a status file

2012-07-13 Thread Chris Gonnerman
On 07/13/2012 11:00 AM, Prasad, Ramit wrote: Well "neat tricks" aside, I am of the firm belief that deleting files should never be possible whilst they are open. This is one of the few instances I think Windows does something better than OS X. Windows will check before you attempt to delete (i.e