Jump to content

Recommended Posts

Posted

The app I've inherited maintenance for (VB .Net 2.0 Windows Service) reads various text files.

 

It was writtin using the Microsoft.VisualBasic.FileIO.TextFieldParser class.

 

When the code gets here:

Using parser As New TextFieldParser(currentFile)

it may throw an exception if the file hasn't been completely written. (It's a folder monitor service)

 

So, my two questions:

For testing purposes, what's a quick/easy way to set a file as in use to trigger the exception?

I'd like to check for in use, and then wait for a second or two, try again, and if it's still not available then fail. How can I check if a file is in use?

 

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...