Apache Ant Chmod Task
Ant Chmod is used to change the file permissions. It works only for Unix type kernel based systems. It also allows all the arguments passed during the chmod command.
It supports all the FileSet's attributes and nested elements directly. From Ant 1.6, it also supports nested filelists.
Ant Chmod Task Attributes
||File name of which the permissions must be changed.
||Exactly one of the two, unless nested <fileset|filelist|dirset> elements are specified
||The directory which holds the files whose permissions must be changed.
||the new permissions.
||A list of patterns of files that must be included.
||No; defaults to all (**)
||A list of patterns of files that must be excluded.
||No; defaults to default excludes or none if defaultexcludes is no
||It indicates whether default excludes should be used or not.
||No; defaults to yes
||It process all specified files using a single chmod command.
||No; defaults to true
||Set Either dir, file or both.
||No; default is file
||A Limit the amount of parallelism by passing at most this many sourcefiles at once.
||No; defaults to unlimited
||Whether to print a summary after execution or not.
||No; defaults to false
||A list of Operating Systems on which the command may be executed.
||OS family name.
||No; defaults to unix
Ant Chmod Task Example
We can make start.sh file readable and executable by using the below lines.
make readable, writable and executable only for the Unix Owner.
Make all files readable, writable.