473,699 Members | 2,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: I/O error 13 Permission denied -Cannot access file as it is usedby another process.

aditya shukla wrote:
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.NamedT emporaryFile(su ffix='_suffix', prefix='prefix_ ',dir='C:\\Pyth on25')
- #this how create the temporary file ( i am not closing the temporary
file).This works fine
Why on earth are you *specifying* c:\python25 as the
directory for this file? It's automatically created
in your user-specific temp directory which has specific
permissions and is (obviously) specific to that user.
You may -- depending on your needs -- also not need the
suffix & prefix.

ie, unless you have some specific need in mind, just use:

temp = tempfile.NamedT emporaryFile ()
x= os.path.split(t n)

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

The main stumbling block here is that you're not posting
code you're running, but fragments of code which may or
may not exist in your source. What is tn? What have x
and y to do with anything? What is find_file? And so on.

As far as I can tell you're trying to create a temporary
file, pass its name to another process which writes to
it. You then, in the first process, read the results of
the second process. Is that right?

At the very least, please cut-and-paste a session from
the console which is running the program so that the traceback
is clear.

Thanks
TJG
Aug 28 '08 #1
0 1848

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3548
by: Colin Graham | last post by:
I am working with a piece of javascript that i have inherited from another developer. It is for a date picker function and it runs fine locally but i get an error when i deploy it on the server and run it. Can anyone help me with my issue i get a permission denied error also when the error begins. i get the error on the folowing part of the codee: window.opener.Form1.txtDate.value = '05/10/2004' The complete line of code is
2
1273
by: nospam | last post by:
Hi, How can I have more than one argument in this statement? Adding a second one gets an error. Process myProcess = Process.Start("ABC.exe", "arg1");
6
4490
by: karim | last post by:
I have an asp.net page that stopped running properly giving the error below. The app uses a SQL Server 2000 on another server. Enterprise Manager and Query analyzer on the web server can connect to that sql server just fine and run queries. I rebooted the web server and made aspnet member of the admin group. I don't know why the error mentions open connections if I can open several query anaylzer windows using the same sql server...
2
5072
by: james | last post by:
Not sure if this is the right group, but anyway. I've built a setup project in vs2005 to install my program. All works fine, until I issue an update. If anyone tries to install it, they get the error "Another version of this product is already installed". They then need to go to Add/Remove programs to uninstall before trying again. I did find a workaround of changing the product code in my setup project, and then they can install it, but...
4
4889
by: chaz | last post by:
here is the html : <br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="<%=LABEL_WIDTH%>" class="formtext"><%= HTEXT("Connection type:")%></td> <td class="formtext"> <input type="radio" class="inputRadio" id="dbStatus" name="dbStatus" value="1" onclick="changeDbStatus(1)" <%if dbStatus=1 then%checked
6
6254
by: scottrm | last post by:
Hi Users seem to be getting the following intermitent error whe they post a form. Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKeyconfiguration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
1
2771
by: Praveen | last post by:
I have configured the system database backup using SQL Server 2005 Maintenance Plan. It was running properly quite some time with in 5 to 10 minutes. Suddenly I am getting this error "Process is terminated due to StackOverflowException. The return value was unknown. The process exit code was -2147023895". And the back up did not complete for 55 minutes and finally it got failed. Somebody good help me out pls. rgs Praveen
2
1871
by: FutureShock | last post by:
I am using a registration class to process a registration form and need some opinions on returning error messages. I am self referring the page on submit. I would like to send each form field to the class for processing (validating, sanitizing, etc..) So far no problem. Now I am throwing ideas around on how best to check for error messages to the users.
2
1273
by: sarabonn | last post by:
hello everyone, I have created a setup using setup and deployment project using visual c# 2008. It's is a windows Form application. I made some changes to the setup in visual c# and tried to install it again i got a error "another version of the project is installed". how can i get rid of this ?.. Thank you.. Dinesh.
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.