• I believe you can use the FileInfo.OpenWrite() method to check if the file is avaialbe for opening to write (assuming that you will not be able to if something else is writing to it)

    Dim oLoadFile As FileInfo = New FileInfo(cFilePath)

    Dim lComplete As Boolean

    Complete = False

    ...

    'Loop until the file is openable (e.g. FTP or copy complete) or iTimeOut is reached

    While lComplete = False

    lComplete = True

    Try

    oLoadFile.OpenWrite()

    Catch

    lComplete = False

    System.Threading.Thread.Sleep(iCycleTime)

    End If

    i += iCycleTime

    If i > iTimeOut Then

    Exit While

    End Try

    End While

    ...etc

    If it ain't broke, don't fix it...