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
Name | Type | Description | Default | Required |
---|---|---|---|---|
file
|
String
| The file or directory of which the permissions must be changed. | n/a | Yes |
readonly
|
Boolean
| The readonly permission. | n/a | at least one of the four. |
archive
|
Boolean
| The archive permission. | n/a | |
system
|
Boolean
| The system permission. | n/a | |
hidden
|
Boolean
| The hidden permission. | n/a | |
verbose
|
Boolean
| Whether to print a summary after execution or not. Defaults to false. | false | No |
os
|
String
| List of Operating Systems on which the command may be executed. | n/a | No |
<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"/> </attrib>
makes all ".xml" files below ${meta.inf} readable.