【问题标题】:Nant and changing file properties (read-only to writable)Nant 和更改文件属性(只读到可写)
【发布时间】:2008-09-16 18:26:50
【问题描述】:

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

【问题讨论】:

    标签: nant


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-06
        • 2018-12-15
        • 1970-01-01
        • 1970-01-01
        • 2014-10-20
        • 2010-09-18
        • 2010-12-05
        • 1970-01-01
        相关资源
        最近更新 更多