How to detect if the file is in use by another process?

P

pradeepsrinivasa

Hello all,
We have our own disk monitoring service (C++ code) running as Windows
service. This monitors the free disk space and deletes files and
folders, in specific folders, if necessary.

The product runs on both Win2k and Win2k3, with typical configuration
as follows:
P4 3GHz Dual Processor
1GB RAM
70GB Harddisk

When the system is under load, ( the free disk space is around 500 MB),
some of the folders are not deleted, even though there are no files.
The error is due to the fact the folder is being used by another
process.
We wanted to know how we can detect if the folder is in use by another
application?

Best Regards,
Srinivasa Pradeep
 
B

barry

Hello all,
We have our own disk monitoring service (C++ code) running as Windows
service. This monitors the free disk space and deletes files and
folders, in specific folders, if necessary.

The product runs on both Win2k and Win2k3, with typical configuration
as follows:
P4 3GHz Dual Processor
1GB RAM
70GB Harddisk

When the system is under load, ( the free disk space is around 500 MB),
some of the folders are not deleted, even though there are no files.
The error is due to the fact the folder is being used by another
process.
We wanted to know how we can detect if the folder is in use by another
application?

Best Regards,
Srinivasa Pradeep


This type of thing?
http://www.sysinternals.com/utilities/handle.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top