avoiding file corruption

Grant Edwards grante at visi.com
Sun Aug 27 10:41:05 EDT 2006


On 2006-08-27, Amir  Michail <amichail at gmail.com> 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. 

Likewise, if I want to have a file open for writing twice,
that's my business as well.  I certainly don't want to be
hobbled to prevent me from wandering off in the wrong direction.

> 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.

It's all to easy to delete the wrong element from a list.  It's
all to easy to re-bind the wrong object to a name.  Should
lists be immutable and names be permanently bound?

-- 
Grant Edwards                   grante             Yow!  I'm in a twist
                                  at               contest!! I'm in a
                               visi.com            bathtub! It's on Mars!! I'm
                                                   in tip-top condition!



More information about the Python-list mailing list