SetAttributes Normal doesn't always set

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
 
B

BrianB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top