SetAttributes Normal doesn't always set

  • Thread starter Thread starter BrianB
  • Start date Start date
B

BrianB

I have a tool that copies a bunch of files from a read-only share to a
working share. After the copy it calls:

File.SetAttributes(strDest, FileAttributes.Normal)

I'm logging the read-only attribute before and after the SetAttributes.

If I build the exe and run it, not in debug mode, the permission on most,
but not all, of the files is set to Normal. There are no errors or
exceptions being caught by the Try...Catch for the files that stay
read-only.

If I run the tool within VB 2005 in debug mode and step through the exact
same set of files (after deleting everything in the destination folder
first), all the files are successfully set to Normal.

Any ideas?

Brian
 
On additional tidbit of information. If I include a two second pause after
the SetAttributes, all files are successfully set to Normal.

Any ideas what is going on? Putting in the pause results in very
unacceptable run time.

Brian
 
Back
Top