LordHits
LordHits

Reputation: 5083

Nant and changing file properties (read-only to writable)

As part of the Nant copy task, I would like to change the properties of the files in the target location. For instance make the files "read-write" from "read-only". How would I do this?

Upvotes: 9

Views: 2794

Answers (2)

LordHits
LordHits

Reputation: 5083

Also, for a list of files, the command is:

<attrib readonly="false">
  <fileset basedir="mydirectory">
    <include name="**"/>
  </fileset>
</attrib>

Upvotes: 7

Phillip Wells
Phillip Wells

Reputation: 7662

Use the <attrib> task. For example, to make the file "test.txt" read/write, you would use

<attrib file="test.txt" readonly="false"/>

Upvotes: 11

Related Questions