📜  Apache Ant移动任务

📅  最后修改于: 2020-12-26 14:03:35             🧑  作者: Mango

Apache Ant移动任务

此任务用于将文件移动到新文件或目录。它还可以用于将文件集移动到新目录。默认情况下,如果目标文件已存在,则目标文件将被覆盖。

file属性用于将文件或整个目录移动到新的目标目录。

Attribute Description Required
file The file or directory to be moved. Yes
preservelastmodified Preserve the last moved file name No
tofile The destination file. Yes
todir The destination directory. Yes
overwrite It overwrites existing files even if the destination files are newer. No
force It overwrites read-only destination files. No
filtering It indicates whether token filtering should take place during the move. No
flatten It ignores directory structure of source directory. No
includeEmptyDirs It copies empty directories. No
failonerror If false, log a warning message. No
quiet It does not log a warning message when the file to copy does not exist. No
verbose Log the files that are being moved. No
encoding It is used to specify encoding format. No
outputencoding The encoding to use when writing the files. No

Apache Ant移动任务示例

将文件移动到新文件。

    
    
        
    

将文件移动到目录。

    
    
        
    

将目录移动到新目录。