By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,207 Members | 1,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,207 IT Pros & Developers. It's quick & easy.

filesystemwatcher and determining when it is safe to work on the directory

P: n/a
When using filesystemwatcher to keep an eye on a directory to see if
there are any files, how will I know when it is safe to work on the
files in a directory? In other words, how will I know that no more
files are being written and that the directory is static?

-topher

Jan 31 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You cant know that nobody is writing a file exactly. You could check to see
whether there are any open handles to the directory or files in the
directory. I dont know how to do this exactly but if I had to, I would look
at the source code to the ForceDelete tool that floats around the web and
this finds file handles and closes them with WinAPI calls.

HTH
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"topher" wrote:
When using filesystemwatcher to keep an eye on a directory to see if
there are any files, how will I know when it is safe to work on the
files in a directory? In other words, how will I know that no more
files are being written and that the directory is static?

-topher

Jan 31 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.