Nant和更改文件属性(只读为可写)

Lor*_*its 7 nant

作为Nant复制任务的一部分,我想更改目标位置中文件的属性.例如,使文件从"只读""读写".我该怎么做?

Phi*_*lls 9

使用< attrib >任务.例如,要使文件"test.txt"读/写,您将使用

<attrib file="test.txt" readonly="false"/>
Run Code Online (Sandbox Code Playgroud)


Lor*_*its 6

此外,对于文件列表,命令是:

<attrib readonly="false">
  <fileset basedir="mydirectory">
    <include name="**"/>
  </fileset>
</attrib>
Run Code Online (Sandbox Code Playgroud)