Re: Why Can't I Delete a File I Created with Win XP?

2009-12-07 Thread John Machin
On Dec 5, 9:57 pm, "W. eWatson" wrote: [snip] >          s = self.current_path s referred to something ... >          s = "Analysis" but now s refers to "Analysis" ... at best, there is redundant & confusing code; at worst, the source of your problem. >          s = os.path.join("Analysis",s) and

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-06 Thread Dave Angel
Hans Mulder wrote: J wrote: But that being said, this brings to mind a question about this... in *nix, when I can't do something like delete a file or directory, or unmount a filesystem and cant find the cause, I can do an lsof and grep for references to the file/directory in question,

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-06 Thread Hans Mulder
J wrote: But that being said, this brings to mind a question about this... in *nix, when I can't do something like delete a file or directory, or unmount a filesystem and cant find the cause, I can do an lsof and grep for references to the file/directory in question, then work from the

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 23:17, W. eWatson wrote: > J wrote: >> And those are your only options, really.  From what I've been able to >> see, there is no native ability in Linux to actually see who has a >> lock on a file that's been opened.  And I completely understand your >> frustration. Crud..

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
J wrote: On Sat, Dec 5, 2009 at 21:14, W. eWatson wrote: What I'm trying to do is really simple. In the Win XP NG, I have two suggestions to get rid of the Analysis folder and the empty file in it. One is to use a program like you suggested, and the other is to delete it from DOS. I just tried

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread Tom Pacheco
W. eWatson wrote: I'm trying to store analytic data in a folder called Analysis. If the user doesn't have the folder, I make one for him, and then write a txt file into it. In this case a histogram of values, x and frequency. However, it appears that I made a mistake somewhere and cannot delete

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread Stephen Hansen
te the file. There's really nothing at all to this otherwise-- this isn't really even a python thing. In windows, as long as a file is held open, you can't delete a file. When a program closes it almost always ends up automatically closing all the files it had open-- so if you&#

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 21:14, W. eWatson wrote: > What I'm trying to do is really simple. In the Win XP NG, I have two > suggestions to get rid of the Analysis folder and the empty file in it. One > is to use a program like you suggested, and the other is to delete it from > DOS. I just tried cmd

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
The original program and code are not mine. I have no idea if that specific piece of code has ever been tested. Generally the program works quite well, and when needed creates the Events folder without any difficulty. That folder is used heavily by writing new data files to it thousands of time

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
J wrote: On Sat, Dec 5, 2009 at 20:32, J wrote: connections eventually. So being able to find who has a lock on a given file or directory if the program dies unexpectedly would be useful. Google tells me that the program Process Explorer from SysInternals will provide most of the functional

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 20:32, J wrote: > connections eventually.  So being able to find who has a lock on a > given file or directory if the program dies unexpectedly would be > useful. Google tells me that the program Process Explorer from SysInternals will provide most of the functionality of

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
for you... applicable to any language, not just python. But that being said, this brings to mind a question about this... in *nix, when I can't do something like delete a file or directory, or unmount a filesystem and cant find the cause, I can do an lsof and grep for references to the file/d

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread John Machin
On Dec 6, 2:46 am, "W. eWatson" wrote: [snip] >          f = file( s, "wb" ) >          if not f: >              self.LogError( "File creation error 1" ) >              return False Either you are shadowing the built-in function file() or you haven't tested this code ... file() aka open() retur

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
The program code is not mine, but I wanted to modify it to produce an Analysis folder when the user wants histogram file, basically, a txt file to appear in Analysis. Elsewhere in the program this is done for another type of data that is directed to an Events folder. I figured I could copy the

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread anand jeyahar
simple when the python program ended, the file handle created by it was still open... so windows will not allow you to delete it (the standard behaviour, when a parent process dies, with a sub-process running is to keep the child running.) try logging off and back on.it will solve the p

Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
I'm trying to store analytic data in a folder called Analysis. If the user doesn't have the folder, I make one for him, and then write a txt file into it. In this case a histogram of values, x and frequency. However, it appears that I made a mistake somewhere and cannot delete it using the Win

Re: Delete a file from a CGI

2007-06-04 Thread Steve Holden
t;permission denied" OSError >>> os.remove(".lock") >>> >>> I've seen that the script is running as "nobody", but, the file is rwx by >>> everybody. I've also tryed changing the owner of the file to "nobody" >>>

Re: Delete a file from a CGI

2007-06-02 Thread Matias Surdi
script is running as "nobody", but, the file is rwx by >> everybody. I've also tryed changing the owner of the file to "nobody" >> also, but no luck anyway. >> >> Thanks a lot. >> >> >> Steve Holden wrote: >> >>&

Re: Delete a file from a CGI

2007-06-01 Thread Steve Holden
e("") > lock_file.close() > # But the following line raises a "permission denied" OSError > os.remove(".lock") > > I've seen that the script is running as "nobody", but, the file is rwx by > everybody. I've also tryed changing the owner

Re: Delete a file from a CGI

2007-06-01 Thread Matias Surdi
r os.remove(".lock") I've seen that the script is running as "nobody", but, the file is rwx by everybody. I've also tryed changing the owner of the file to "nobody" also, but no luck anyway. Thanks a lot. Steve Holden wrote: > Matias Surdi wrote: &g

Re: Delete a file from a CGI

2007-06-01 Thread Gerardo Herzig
When you execute a cgi, the program runs under the "apache user" (ussualy www or wwwrun or so), so THAT user needs permissions for deleting the file. Other approach could be suid'ing the cgi program. Gerardo >HI! > >I want to delete a file from a CGI, but I always

Re: Delete a file from a CGI

2007-06-01 Thread Steve Holden
Matias Surdi wrote: > HI! > > I want to delete a file from a CGI, but I always get a Permission denied > error. > > I've tryed this after creating the file (from a normal script): > > os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_

Delete a file from a CGI

2007-06-01 Thread Matias Surdi
HI! I want to delete a file from a CGI, but I always get a Permission denied error. I've tryed this after creating the file (from a normal script): os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG)) os.chown(".lock",pwd.getpwnam("nobody

Re: Delete a file

2006-02-17 Thread Ravi Teja
No! It's .. os.remove(filename) or os.unlink(filename) -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete a file

2006-02-17 Thread Frank Potter
system.remove(filename) On 2/18/06, Sbaush <[EMAIL PROTECTED]> wrote: > Hi. > In my application i create a PNG image and i view it in a frame. > How can delete it from my python code? > Bye... > > -- > Sbaush > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org

Delete a file

2006-02-17 Thread Sbaush
Hi.In my application i create a PNG image and i view it in a frame.How can delete it from my python code?Bye...-- Sbaush -- http://mail.python.org/mailman/listinfo/python-list