473,771 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 filesystemwatch er, 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 1938
Hi,
"Gunnar" <su*****@GGGMMM AAAIIILLL.COM> wrote in message
news:eA******** ******@TK2MSFTN GP03.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
1600
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 more. I broke the mirror for the OS, rebuilt the Windows 2000 installation, and installed MS-SQL 2000 and SP3 so that now the server is configured identically to what it was before the crash. Now I have the databases in D:\Program...
6
5303
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 report any error while writing to the open file handle. On Windows, file shows-up again in explorer and automatically deleted finally when program ends. On Unix, same thing happens if file is on nfs mounted drive, but in this case, actual file is...
3
1430
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. Every time I have to manually to make sure that a function referenced in one file is defined in another so my host won't crash due to exception. I have been trying to put in a detect-and-execute logic in my code for some time but with no real...
3
2092
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 program, so that the program can check for that key to see if the product has been installed and stop a second installation or illegal installation. If not orphan, can you encrypt the Key so that only your program can decrypt
11
3945
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
9949
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> #include <string> using namespace std; int main () {
6
7761
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 looking for some tool which would detect any functions that are never used at all? or any classes that are created but not instantiated. This is required for an application which includes hundreds of C++
36
5404
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 are configured to use Notepad to open the file by default and if they are configured to use Notepad by default I want it to remain that way rather than retrieve the text into my app or force the user to use another app to read the file. I'm...
13
1544
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 to callers both in "debug" and "release" versions. The release versions of the libraries are A, B, and C (.lib and .dll), while the debug versions are A_debug, B_debug, and C_debug (.lib and .dll). Now, because these libraries maintain internal...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.