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

Posted on 2007-08-02
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 85

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction While answering a recent question ( 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…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    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…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now