FileSystemWatcher

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Balu

    #1

    FileSystemWatcher

    Hi,

    I am using the FileSystemWatch er object to watch for a
    specific file being created in a directory (with a
    timeout):

    fileWatcherResu lt = fileWatcher.Wai tForChanged
    (WatcherChangeT ypes.Created, 180000);

    After the file is crated I try to open it.
    The problem is that the file is created by another
    process and if I try to read from the file immediately
    after it is created (i.e. after WaitForChanged returns)
    then I get the error that the file is still in use by the
    other process. If I put in a small delay before I read
    the file then it works fine. Is there any simple way to
    solve this without using the delay?

    Thanks in advance
Working...