Why does copying a file using FileInfo.CopyTo creates the destination copied file as readonly ?

Posted by Puneet Dudeja on Stack Overflow See other posts from Stack Overflow or by Puneet Dudeja
Published on 2010-06-11T10:31:17Z Indexed on 2010/06/11 10:43 UTC
Read the original article Hit count: 233

Filed under:
|

I have two folders in my asp.net web application in which I create new folders programmaticaly. The entire solution is under VSS source control.

I was not able to manipulate these two folders programmably. For that, I gave {MACHINE}\ASPNET user account full control over these two folders.

Still, the "access denied to the path" error was coming. I saw that these entire folders were marked readonly. I tried to uncheck Readonly from explorer but not successfull, readonly check does not get removed.

Also, if I copy files using method, the destinationn copied file becomes readonly. I have also tried File.SetAttributes(path,FileAttributes.Normal); but no success.

How can I make the copied file not READONLY ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET