Re: avoiding file corruption

2006-08-28 Thread Cliff Wells
On Sun, 2006-08-27 at 07:51 -0700, Amir Michail wrote: > How often do you need to open a file multiple times for writing? How often do you write code that you don't understand well enough to fix? This issue is clearly a problem within *your* application. I'm curious how you could possibly think

Re: avoiding file corruption

2006-08-27 Thread Duncan Booth
Dennis Lee Bieber wrote: > On Sun, 27 Aug 2006 14:41:05 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> 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

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > How often do you need to open a file multiple times for writing? Not very often, but I don't think it should be illegal. That's probably a result of being a 25 year user of Unix where it's assumed that the user knows what he's doing. > A

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
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 f

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Paddy wrote: > I've never done this in anger so feel free to mock (a little :-). > > I'd have a fixed field at the beginning of the field that can hold the > hostname process number, and access time of a writing process, togeher > with a sentinal value that means "no process has access to the file

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Grant Edwards wrote: > On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> 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

Re: avoiding file corruption

2006-08-27 Thread Tim Scheidemantle
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. Look at fcntl module, I use it in a class to control access from within my processes. I don't think this functionality should be inherent to python though. Keep in mind

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> 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 f

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Amir Michail wrote: > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. The right solution is file locking.

Re: avoiding file corruption

2006-08-27 Thread Diez B. Roggisch
Amir Michail schrieb: > Diez B. Roggisch wrote: >> Amir Michail schrieb: >>> Paolo Pantaleo wrote: 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. >

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Diez B. Roggisch wrote: > Amir Michail schrieb: > > Paolo Pantaleo wrote: > >> 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > >>> Hi, > >>> > >>> Trying to open a file for writing that is already open for writing > >>> should result in an exception. > >>> > >>> It's all too easy t

Re: avoiding file corruption

2006-08-27 Thread Paddy
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. > > Amir I've never done th

Re: avoiding file corruption

2006-08-27 Thread Diez B. Roggisch
Amir Michail schrieb: > Paolo Pantaleo wrote: >> 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: >>> Hi, >>> >>> Trying to open a file for writing that is already open for writing >>> should result in an exception. >>> >>> It's all too easy to accidentally open a shelve for writing t

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Paolo Pantaleo wrote: > 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > > Hi, > > > > Trying to open a file for writing that is already open for writing > > should result in an exception. > > > > It's all too easy to accidentally open a shelve for writing twice and > > this can le

Re: avoiding file corruption

2006-08-27 Thread Paolo Pantaleo
27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corru

avoiding file corruption

2006-08-27 Thread Amir Michail
Hi, Trying to open a file for writing that is already open for writing should result in an exception. It's all too easy to accidentally open a shelve for writing twice and this can lead to hard to track down database corruption errors. Amir -- http://mail.python.org/mailman/listinfo/python-lis