Name

move

Synopsis

Moves one or more files and directories.

Attributes

file (all, File, *)

Specifies a single file to move. Use nested <fileset>s to move multiple files and directories.

filtering (all, boolean, N)

If true, token filtering using any global buildfile filters takes place. Nested filters are always applied, regardless of this attribute. Defaults to false.

flatten (all, boolean, N)

If true, the directory structure of the source files is not preserved, moving all files to a single destination directory. A nested <mapper> can achieve the same results. Defaults to false.

includeemptydirs (all, boolean, N)

If true, empty directories are also moved. Defaults to true.

overwrite (all, boolean, N)

If true, files are moved even when destination files are newer. Defaults to false.

todir (all, File, *)

The directory to move files to.

tofile (all, File, *)

The file to move to.

Either file or a nested fileset element is required. When the file attribute is used, one of either tofile or todir is required. When a nested fileset is used, only todir is allowed: it’s also required.

Content

0..n nested <fileset> elements (all)

Selects files to move. The todir attribute is required when <fileset>s are present.

0..n nested <filterset> elements (1.4)

Defines token filters for text substitution as files are moved. See the filter task for more info.

0,1 nested <mapper> elements (1.3, 1.4)

Defines how filenames are transformed when moved. By default, an identity transformation is performed, meaning that filenames ...

Get Ant: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.