473,387 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Detect orphan files after program crash

Are there any way of detecting that a program have crashed and left an
orphan file?
I have tried with the filesystemwatcher, but that didn't work.

Maybe I can use a polling strategy and keep polling the file and check if it
is locked. But can I do this without trying to open the file and catch
exeption.
Any suggestions are welcome?

Regards
Gunnar
Jun 1 '06 #1
1 1914
Hi,
"Gunnar" <su*****@GGGMMMAAAIIILLL.COM> wrote in message
news:eA**************@TK2MSFTNGP03.phx.gbl...
Are there any way of detecting that a program have crashed and left an
orphan file?
What you mean with an orphan file?

Maybe I can use a polling strategy and keep polling the file and check if
it is locked. But can I do this without trying to open the file and catch
exeption.


If the file is locked then the program is still running.

You can check the process list to see if a program is running or not.

And no, AFAIK the only way to really know if you can open a file is trying
to open it and handling the exception

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jun 1 '06 #2

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

Similar topics

1
by: thomas.cameron | last post by:
Howdy all - I am *not* a DBA, so please bear with me. A client's Windows 2000 server went belly up yesterday afternoon after getting updates from Windows Update. Wouldn't come up at all any...
6
by: Kiran | last post by:
Hi, I have program, which opens file at the startup and logs error messages to the file, file handle is closed at the end of the program. However if file is deleted in-between, program do not...
3
by: Jay | last post by:
Hi, Everybody: I have a script host that implemented in Java and using FESI to run JavaScript. The JavaScript files are separated into different files and putting together at run or load time....
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to create a registry key, but orphan it from the program that created it? Reason: Create a key, but not associate it with the...
11
by: Jonathan Wilson | last post by:
Is there some way I can do something like this #if <running on Visual C++ 2005 SP1> //SP1 code here #else //other code here #endif
17
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream>...
6
by: sanjay | last post by:
Hi, Is there any tool that would do static detection (doesnt execute the application) of dead code for C++ application. Few tools do show which code flow would never get executed, but i am...
36
by: Don | last post by:
I wrote an app that alerts a user who attempts to open a file that the file is currently in use. It works fine except when the file is opened by Notepad. If a text file is opened, most computers...
13
by: Bob Altman | last post by:
Hi all, I have authored several native DLLs (call them A, B, and C). These libraries have references between each other (A calls B which calls C). These libraries are built and made available...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.