Javatpoint Logo
Javatpoint Logo

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

Attribute Description Required
file File name of which the permissions must be changed. Exactly one of the two, unless nested <fileset|filelist|dirset> elements are specified
dir The directory which holds the files whose permissions must be changed.
perm the new permissions. Yes
includes A list of patterns of files that must be included. No; defaults to all (**)
excludes A list of patterns of files that must be excluded. No; defaults to default excludes or none if defaultexcludes is no
defaultexcludes It indicates whether default excludes should be used or not. No; defaults to yes
parallel It process all specified files using a single chmod command. No; defaults to true
type Set Either dir, file or both. No; default is file
maxparallel A Limit the amount of parallelism by passing at most this many sourcefiles at once. No; defaults to unlimited
verbose Whether to print a summary after execution or not. No; defaults to false
os A list of Operating Systems on which the command may be executed. No
osfamily OS family name. No; defaults to unix

Ant Chmod Task Example

We can make file readable and executable by using the below lines.

make readable, writable and executable only for the Unix Owner.

Make all files readable, writable.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA