Could not find the appropriate keywords for the search so..

Scenario:

a file is opened by some proggy with flags that do not allow delete operation on that file
the proggy crashes before closing that file.. so the file remains "in use"

My questions:


is there a way I can get the handle used for openning that file?

or is it at all possible to "free" that file from its imaginary users?



no reboots please :tongue:




-- delete me --

I checked the task list.. found 3 instances of Excel
that crashed, killed them which "unlocked" the file
Posted on 2003-10-16 09:12:21 by Azrim
When an app crashes, these types of handles it took get released just like in a normal exit:
Heap
Files
Loaded libraries
GDI objects
(I know of experience)
The following are not instantly (or ever) released:
DirectSound objects (if cooperative level is set to desktop)
MIDIin/out handles
Posted on 2003-10-17 06:40:51 by Ultrano
Reboot, and don't run Excel :tongue:
Posted on 2003-10-17 07:54:43 by sluggy
Hi Azrim!

Do you know if the crashing program is multithreaded? If so, and depending on the operating system, you might be able to find an offending orphaned process and kill that process. This *might* let you delete the file without a reboot. Otherwise, I don't have any suggestions.

Charles

PS to Sluggy: I never have trouble with Excel:grin: !
Posted on 2003-10-18 15:39:47 by cdquarles
Excel just crashed every time I tried to select some cells after turning "Auto Filter" on
... 3 times in a row, I got the file over email.. no macros..
Just a microsoftish style application behaviour I guess.
Posted on 2003-10-18 16:56:06 by Azrim
Hi Azrim,

Which version do you have? I am using the 2002 version (with Office XP), and I tried to duplicate your problem; but I have never had a problem with it. I am also using Windows XP Professional. My version is multithreaded. Post your OS version and Excel version. It is possible that your problem is related to the file that you received. I can kill threads (processes) if necessary.

Charles
Posted on 2003-10-18 20:46:42 by cdquarles
AFAIK , killing a thread won't solve problems. It'll just bring more. No file handles get released when a thread terminates - unlike when the whole process ends.
Azrim, any chance you have installed bad (irrelevant for your os) version of DCOM ?
Posted on 2003-10-19 14:18:02 by Ultrano
Hi Ultrano,

Okay. I have an executable open that spawned subprocesses. The executable dies, which should have killed the subprocesses; but a file or files have attributes marked which tell the operating system that these files are still in use by a program that terminated abnormally. Since we don't know which operating system is in use, we don't know whether the original executable left running duplicates of itself holding handles to said files. If there are no such processes running, then I don't see how this problem can be solved short of logging off or a full restart. Since this particular problem has never happened to me, I was just speculating. Microsoft Office applications do make backup copies of files that were in use just in case it crashes so that you can start over at the point where it made a backup copy. Sometimes these get left behind, but restarting the application and opening the file and then saving it normally will clear these. I have had a power supply go down while using the computer to create a Word document. All I had to do was reopen the file. This, though, isn't what Azrim is talking about if I understand him correctly.

Azrim, did you have AutoSave on when you ran Excel, by the way?

Thanks for the info,

Charles
Posted on 2003-10-20 00:04:03 by cdquarles
Hi Ultrano,

He he and slap head (always read the whole original post)! Azrim checked his task list and found three instances of Excel in the list. When he killed them, the file's in use attribute was cleared. However, I don't think that we will be able to help him find out why he had a problem with the file in the first place without more info.

Charles
Posted on 2003-10-20 00:10:47 by cdquarles
sorry, I was "offline" a bit more than I expected :(


Sysinfo:

Win2k SP 4, Excel 2000 (9.0.3821 SR-1)

I got the file over e-mail from a "friend" that was using a newer version of Office
i do not have the original file now.. nor the original email..

I will try to reproduce this behavior in a moment.

You could be right about DCOM

I do have a lot of stuff on this computer
.NET Enterprise, SQL Server 2000, Win2k Res. Kit, ..etc.
Posted on 2003-10-20 02:37:55 by Azrim
Hi Azrim,

If you can, upgrade to Excel 2002. Excel 2000 had a lot of teething problems related to (IMO) a poor implementation of unicode handling. Excel 97 was ASCII. Excel 2002 fixed a lot of unicode related bugs.

Charles
Posted on 2003-10-20 10:01:03 by cdquarles
tnx all,


I should ask.. by just knowing the file name
how can I get a list of processes that have open file handles to that file?
Posted on 2003-10-20 13:40:04 by Azrim
Hi Azrim,

Go to www.sysinternals.com and download every free tool they have. They have a number of file monitors, process monitors, etc.

Charles
Posted on 2003-10-20 21:27:20 by cdquarles
Thanks,


one more thing, :( muhahahaha I just love office
Posted on 2003-10-21 03:14:58 by Azrim
it's a grammar error, that's why it's underlined.
Posted on 2003-10-21 05:04:18 by Ultrano
yes, but why not another color

"Delete repeated word"
Posted on 2003-10-21 05:43:06 by Azrim

it's a grammar error, that's why it's underlined.
grammar errors are in green by default.
red is just for errors in typing: spelling, double word, etc.
Posted on 2003-10-21 21:31:01 by bitRAKE
Hi Azrim,

BTW, Excel 2000 cannot read 2002 or later format files. If your friend did not save it in 97 or 2000 format, your version cannot handle it. That's probably why it crashed on you.

Charles
Posted on 2003-10-21 22:51:38 by cdquarles