Re: Help recursively setting readonly attribute

Chris Fouts <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <[email protected]>
I got it to work this way, that is, without the last * in the <include> elements.

<target name="removeReadOnly"
                description="Remove read-only attribute of files">
                <attrib readonly="false">
                                <fileset> 
                                                <include name="C:\Some Folder\**" />
                                                <include name="C:\Other Folder\**" />
                                </fileset> 
                </attrib>
</target>

-----Original Message-----
From: Wilson, Brian [mailto:[email protected]] 
Sent: Thursday, May 05, 2011 9:29 AM
To: Chris Fouts
Subject: RE: Help recursively setting readonly attribute

I tried all kinds of options, for the attrib tag and could not get it to work.  I can use a fileset on other tags, like delete and copy, but it does not seem to work with attrib.  The only other option I know of that may work is a foreach loop, that may work for the files as I know this works.  However, I am not sure how to set the attribute for a folder.



Brian Wilson
Programmer Analyst, Associate
Department of Human Resources
Email: [email protected]


From: Chris Fouts [mailto:[email protected]] 
Sent: Wednesday, May 04, 2011 5:01 PM
To: [email protected]
Subject: [NAnt-users] Help recursively setting readonly attribute

I thought I had this, but apparently not, since I can't overwrite files in them. I run as Administrator so I have permission to do this.

I want to set the read-only attribute for all files and subdirs under the two directories

<target name="removeReadOnly"
                description="Remove read-only attribute of files">
                <attrib readonly="false">
                                <fileset> 
                                                <include name="C:\Some Folder\**\*" />
                                                <include name="C:\Other Folder\**\*" />
                                </fileset> 
                </attrib>
</target>

What am I missing?

-chris



***This e-mail message is intended only for the above named recipient(s)
and may contain information that is sensitive or proprietary. If you have
received this message in error or are not the named recipient(s), please 
immediately notify the sender, delete this e-mail message without making
a copy and do not disclose or relay this e-mail message to anyone.***

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.