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
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,
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
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..
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
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
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
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
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
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
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
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
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
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
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
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
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"
>>>
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:
>>
>>&
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
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
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
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_
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
No! It's ..
os.remove(filename) or os.unlink(filename)
--
http://mail.python.org/mailman/listinfo/python-list
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
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
26 matches
Mail list logo