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



J wrote:
On Sat, Dec 5, 2009 at 21:14, W. eWatson <wolftracks@xxxxxxxxxxx> 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 prompt, but was not successful. My DOS skills are long
gone, so I have no idea if there is something I overlooked there. I bored
down to Analysis and the into it. DIR showed an unnamed empty file, so I
tried DEL *. I seriously doubt it was removed.

Well, I'm going to reboot sometime later this evening, and knock it out as I
described I was able to do once before after a reboot. Thne I'm going to fix
the Python program and write a file correctly.

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.

I've not used the process explorer program, so I really can't say how
well it works for this kind of thing. But every post I found
searching for this indicates that it will at least tell you what still
has a lock on the file and maybe then you can figure out what needs to
be closed from there.

Rebooting should always work in cases like this. Rebooting the system
should clear all file locks and is a last resort for a persistent
stale file lock. So yeah, by rebooting, you'll always be able to
release the lock on that file and then delete it once the system is
back and running.

However, that's not something you'd want to do on a production system
except as a last resort. At least, that's not something that I'd want
to do.

So anyway, since you said the code is not yours, does the code
actually close the files anywhere? I'm assuming that it does at some
point, but if not, that really is something that needs to be added in.
As I said in my last post, I am just a novice in the Python stuff,
but I've written enough code in my life to know that you never assume
that a file will be closed properly by the system once the program is
finished running. I'm not saying that YOU specifically are doing
this, but just making the suggestion as this is the kind of problem
that can happen.

Of course, a program that's dying for some reason is a different story... :-)
Well, I'm pretty well done now. I fixed the program so it would write the file and close it. It did this successfully. I'll worry about getting the oddball file deleted later.
.



Relevant Pages

  • Re: Why Cant I Delete a File I Created with Win XP?
    ... DIR showed an unnamed empty file, ... lock on a file that's been opened. ... Rebooting should always work in cases like this. ... but just making the suggestion as this is the kind of problem ...
    (comp.lang.python)
  • Re: first hard evidence that WoW online population has peaked
    ... in to advance and complete quest chains but at any *single session* I ... force me to quit the game. ... but the suggestion I was responding to was one that would lock ...
    (alt.games.warcraft)
  • RE: Question about ReaderWriterLock
    ... I will help to forward your suggestion. ... "BeginUpdateRead" acquires the lock and reads first part of the ... shared resource, while the "UpdateWrite" is called to acquire the writer ... The MSDN Managed Newsgroup support offering is for non-urgent issues ...
    (microsoft.public.dotnet.framework)
  • Re: Performance comparison on Update vs. UpdateBatch - record by record
    ... when tested using a single connection, but will show some variance as ... write lock as it's updating. ... method, and alternating them, over rebooting in-between tests. ... each don't vary widely for each respective methodology, ...
    (microsoft.public.data.ado)
  • Add Capability to Lock the Toolbars in MS Office 2003
    ... MS office needs to add capability to:lock" the tool bars in place. ... We can lock the XP Taskbar toolbars. ... This post is a suggestion for Microsoft, ...
    (microsoft.public.office.misc)