Opening a file, second attempt

Janos Blazi jblazi at hotmail.com
Sun Jul 29 05:35:48 CEST 2001


I'd like to open a file for writing using the os.open function call. But if
the file is already in use, the OS denies access to the file. How do I find
out about this in my Python program? I do tno know the name of the exception
that is raised. I have tried

    if os.access(filename_trunk,os.W_OK)==0:
       print "file not open"
       return

but this does not work, access returns 1, though the file ist not
accessible.

Janos Blazi




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list