B.5 AttribTask

Changes the attributes of a file or all files inside specified directories. Right now it has effect only under Windows. Each of the 4 possible permissions has its own attribute, matching the arguments for the attrib command.

FileSets or FileLists can be specified using nested fileset and filelist elements.

By default this task won't do anything unless it detects it is running on a Windows system. If you know for sure that you have a "attrib" executable on your PATH that is command line compatible with the Windows command, you can use the task's os attribute and set its value to your current os.

Table B.7: Attributes

fileStringThe file or directory of which the permissions must be changed.n/aYes
readonlyBooleanThe readonly permission.n/aat least one of the four.
archiveBooleanThe archive permission.n/a
systemBooleanThe system permission.n/a
hiddenBooleanThe hidden permission.n/a
verboseBooleanWhether to print a summary after execution or not. Defaults to false.falseNo
osStringList of Operating Systems on which the command may be executed.n/aNo

B.5.1 Example

<attrib file="${dist}/run.bat" readonly="true" hidden="true"/>

makes the "run.bat" file read-only and hidden.

<attrib readonly="false">
    <fileset dir="${meta.inf}" includes="**/*.xml"/>

makes all ".xml" files below ${meta.inf} readable.

B.5.2 Supported Nested Tags