Click here to Skip to main content
15,891,714 members
Articles / Programming Languages / C#

FileSystemWatcher vs Locked Files

Rate me:
Please Sign up or sign in to vote.
4.75/5 (6 votes)
7 Dec 2017CPOL2 min read 15.9K   17  
You monitor a folder for new files with FileSystemWatcher and try to move those them on arrival. You get an IOException: ...being used by another process. The copying had not finished. Here, I offer a fairly robust solution to this.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
Ben is the Principal Developer at a gov.uk and .NET Foundation foundation member. He previously worked for over 9 years as a school teacher, teaching programming and Computer Science. He enjoys making complex topics accessible and practical for busy developers.


Comments and Discussions