B
BrianB
I have this code.
If File.Exists(strsource) Then
If File.Exists(strDest) Then
Exit Function
End If
Call File.Copy(strsource, strDest, Me.Overwrite)
If File.Exists(strDest) Then
Try
File.SetAttributes(strDest, FileAttributes.Normal)
Catch ex As Exception
msgbox(ex.GetBaseException.ToString)
End Try
End If
End If
All the strsource files are read-only. The SetAttributes command is supposed
to remove that read-only on the copied file. Most of the time it works, but
occasionally it does not. All of the strsource files have the same owner and
permission values.
If, after the File.Copy I have the program sleep for 2-3 seconds for each
file, then the read-only attribute is successfully cleared for all files.
Obviously this solution kills performance. Any ideas what is happening and
how to solve it without the Sleep?
Brian
If File.Exists(strsource) Then
If File.Exists(strDest) Then
Exit Function
End If
Call File.Copy(strsource, strDest, Me.Overwrite)
If File.Exists(strDest) Then
Try
File.SetAttributes(strDest, FileAttributes.Normal)
Catch ex As Exception
msgbox(ex.GetBaseException.ToString)
End Try
End If
End If
All the strsource files are read-only. The SetAttributes command is supposed
to remove that read-only on the copied file. Most of the time it works, but
occasionally it does not. All of the strsource files have the same owner and
permission values.
If, after the File.Copy I have the program sleep for 2-3 seconds for each
file, then the read-only attribute is successfully cleared for all files.
Obviously this solution kills performance. Any ideas what is happening and
how to solve it without the Sleep?
Brian