代码之家  ›  专栏  ›  技术社区  ›  LordHits

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

  •  9
  • LordHits  · 技术社区  · 16 年前

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

    2 回复  |  直到 16 年前
        1
  •  10
  •   Phillip Wells    16 年前

    使用< attrib >任务。例如,要使文件“test.txt”可读/写,您可以使用

    <attrib file="test.txt" readonly="false"/>
    
        2
  •  6
  •   LordHits    16 年前

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

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