document complete in watch folder object?
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
I have create a watch folder object to c:\temp, but something, the create event is fired when the large file is not completed. Is there any existing method of other event to get the event when the document is completed?
I take it your talking about the FileSystemWatcher. No, there is no event that syas the file has been completely written to and closed. It's impossible to track. The generally accepted work-around is to catch the File Created event, then try opening the file with exclusive access (DenyShare...). When you're finally able to open the file, the other application should be done writing to it. There are exceptions to this, but it depends on the application that's writing the file.
Dave Kreskowiak Microsoft MVP - Visual Basic