need to poll multiple directories for files to register when they finished copying ...

Posted on 2007-08-02
Medium Priority
Last Modified: 2013-11-25
i probably need to use windows service project

FileWatcher does not seem the best option at the moment,
since it will probably raise an events as soon as file(s)
start arriving, while i need to know when each individual  
file is done being copied to our server; in addition, i only
need to track certain subdirectories, not entire tree;
however, may be FileWatcher can be customized to do that ?

but even if i do not use filewatcher, how would i separate
files that have already been checked from ones that have just
arrived ...

thanks in advance,
Question by:AlexF777
1 Comment
LVL 86

Accepted Solution

Mike Tomlinson earned 2000 total points
ID: 19620573
I don't think there is any way to setup the watcher so it only fires when the files are "done" copying.  You just have to watch the size of the files and see when they stop changing...or once you get an event, start a Timer and periodically try to open the files in exclusive access mode.  If it fails then the file is still being copied.  Once the file has been "processed" you can give it a different extension or move it somewhere else so you know it has been dealt with.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question