I/O error 13 Permission denied -Cannot access file as it is used by another process.

aditya shukla adityashukla1983 at gmail.com
Thu Aug 28 03:29:28 EDT 2008


Hello folks,

I am creating a python script[windows vista and python2.5] which accesses
another program(prog2).I my python script i am creating a temporary file and
i write the output of prog2
in this temporary file.

temp =
tempfile.NamedTemporaryFile(suffix='_suffix',prefix='prefix_',dir='C:\\Python25')
- #this how create the temporary file ( i am not closing the temporary
file).This works fine

x= os.path.split(tn)

 y=x[1]

Now  i search for the file and then try to read this file so that i can
perform some calculations.

This step causes the problem
file=open(find_file,"rb") # find_file is the object returned after searching
the file

error mesage:

the process cannot access the file as another process because it is being
used by another program.(prog2 in this case)
i/o error 13 permission denied

Please help me on how can i fix this ? i am using os.system() in my program
to communicate with prog2

Thanks in advance

Aditya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080828/2a79943e/attachment.html>


More information about the Python-list mailing list