Using VB2010
I have a server which is heavily accessed by clients via an ftp server...
Every 10 seconds i need to replace (overwrite) the file.
What is the best way to control (file is being accessed by another user)
Over a whole day i received 2 instances of file is being accesses by another user...
At present i am using the following code...IS THERE A BETTER WAY ?????
retries = 3
While True
Try
If File.Exists(FAll2) Then Kill(FAll2)
Rename(FAll, FAll2)
Exit While
Catch
retries -= 1
If retries = 0 Then
Throw
Else
System.Threading.Thread.Sleep(200)
End If
End Try
End While
Really appreciate any advice
Trob
I have a server which is heavily accessed by clients via an ftp server...
Every 10 seconds i need to replace (overwrite) the file.
What is the best way to control (file is being accessed by another user)
Over a whole day i received 2 instances of file is being accesses by another user...
At present i am using the following code...IS THERE A BETTER WAY ?????
retries = 3
While True
Try
If File.Exists(FAll2) Then Kill(FAll2)
Rename(FAll, FAll2)
Exit While
Catch
retries -= 1
If retries = 0 Then
Throw
Else
System.Threading.Thread.Sleep(200)
End If
End Try
End While
Really appreciate any advice
Trob