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

A

Anthony Ho

Hi,

I use the following:
FileOpen(taskmgrfile, "C:\trend.csv", OpenMode.Random, OpenAccess.Read,
OpenShare.LockRead)
to open a file, but it returns err.number 75 "The process cannot access the
file "C:\trend.csv" because it is being used by another process."

Is there a way to check if the file is in use before I try to open it?

thanks in advance!
 
Z

zacks

Well, you could write your own IsOpen method for the File class, but it
would probably determine if the file is already open by doing the same
thing, ie, try doing a FileOpen in a Try/Catch and catch the already
open exception.
 
B

Bob Lehmann

is there a more positive way?
What the heck does that mean?

Are there self-esteem issues with try/catch?

Bob Lehmann
 
S

Stephany Young

Of course there is Bob!!!!!!!!!!

Didn't you know that constantly trying and failing is one of the main causes
of low self-esteem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top