Home Is there a way to check if a file is in use?
Reply: 0

Is there a way to check if a file is in use?

user511
1#
user511 Published in June 20, 2018, 7:42 am

I'm writing a program in C# that needs to repeatedly access 1 image file. Most of the time it works, but if my computer's running fast, it will try to access the file before it's been saved back to the filesystem and throw an error: "File in use by another process".

I would like to find a way around this, but all my Googling has only yielded creating checks by using exception handling. This is against my religion, so I was wondering if anyone has a better way of doing it?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.43657 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO