NAnt
![]() ![]() ![]() |
v0.85 |
[This is preliminary documentation and subject to change.]
Moves a file or set of files to a new file or directory.
Files are only moved if the source file is newer than the destination file, or if the destination file does not exist. However, you can explicitly overwrite files with the overwrite
attribute.
A <fileset> can be used to select files to move. To use a <fileset>, the todir
attribute must be set.
Attribute | Type | Description | Required |
---|---|---|---|
file | file | The file to move. | False |
flatten | bool | Ignore directory structure of source directory, move all files into a single directory, specified by the todir attribute. The default is false. |
False |
todir | directory | The directory to move to. | False |
tofile | file | The file to move to. | False |
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False |
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False |
includeemptydirs | bool | Copy any empty directories included in the <fileset>. The default is true. | False |
overwrite | bool | Overwrite existing files even if the destination files are newer. The default is false. | False |
unless | bool | Opposite of if . If false then the task will be executed; otherwise, skipped. The default is false. |
False |
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False |
todir
attribute must be set. Move a single file.
<move file="myfile.txt" tofile="mytarget.txt" />
Move a set of files.
<move todir="${build.dir}"> <fileset basedir="bin"> <includes name="*.dll" /> </fileset> </move>