Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

File.Move() Issue with FileSystemWatcher

Feb 26 2003 8:21 PM
I am using the FileSystemWatcher method to watch a folder. When a file arrives it will move the file to a process folder. My problem is when a large file is put in the folder the move command errors with Unhandled Exception: System.IO.IOException: The process cannot access the file "c:\temp\test.zip" because it is being used by another process. Obviously the file has not finished copying to the directory. Is there an attribute on the file that I can check to see if it can be moved or is there a filter that I can use that will only trip the oncreated event after the file has completely copied to the folder.

Answers (1)