Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

Checking to see if a file is in use

I am using filewatcher to watch a specific directory for new files.  Once a new file is created I can fire off a procedure but I want the procedure to wait unti the file is no longer in use.  Wether that means being copied or created.  I know in c# the "isfileinuse" is available does anyone know of anything like that for vb.net?
0
rxresults
Asked:
rxresults
  • 2
2 Solutions
 
CodeCruiserCommented:
I am not aware of any IsFileInUse function in C#. You would have to try to open the file and handle the exception if its in use.
0
 
käµfm³d 👽Commented:
I'm not aware of that function in C# either. I think if you saw it posted somewhere, then it is a user-created function and not something that is inherent to the Framework.

I also agree with CodeCruiser with regard to catching the exception.
0
 
rxresultsAuthor Commented:
Thanks guys.  I thought that was too easy.
0
 
käµfm³d 👽Commented:
I think the points should all go to CodeCruiser. He answered the question; I was just agreeing with him  : )
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now