ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# B.28 MoveTask Moves a file or directory to a new file or directory. By default, the destination file is overwritten if it already exists. When overwrite is turned off, then files are only moved if the source file is newer than the destination file, or when the destination file does not exist. Source files and directories are only deleted if the file or directory has been copied to the destination successfully. B.28.1 Examples ``` <!-- The following will move the file "somefile.txt" to "/tmp" and change its filename to "anotherfile.bak". It will overwrite an existing file. --> <move file="somefile.txt" tofile="/tmp/anotherfile.bak" overwrite="true"/> <!-- This will move the "/tmp" directory to "/home/default/tmp", preserving the directory name. So the final name is "/home/default/tmp/tmp". Empty directories are also copied --> <move file="/tmp" todir="/home/default/tmp" includeemptydirs="true" /> ``` B.28.2 Attributes and Nested Elements For further documentation, see [Section聽B.11](apbs11.html "B.11 CopyTask"), since MoveTask only is a child of CopyTask and inherits all attributes.