Locks on file, or 'WaitFor'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred

    #1

    Locks on file, or 'WaitFor'

    Hii All,

    I have written a C# windows app that uploads a file via FTP onto a server,
    and a C# windows service that picks up the file, unzip it and processes the
    files inside the zip archive.

    The problem I'm having is that I get an IO error when the service attempts
    to unzip the file. My guess is that the FTP process still has some locks on
    the file.

    So my question is how can go around this problem?

    I could wait until the file is 'Free', but I don't know how check if a file
    is in use, available for read/write.

    I could just wait a couple of minutes, but do not know if there is command
    in C# that would tell an application to wait for X seconds. (Could write my
    own, but if it already exists it's pointless).

    Thaks in advance.

    Fred.











Working...