copy

Description

Copies files and directories from one location to another.

Parameters

Table 2. Parameters

Attribute Type Description Required
file string The name of the file to copy. Required unless a fileset is passed in. true
toDir string The destination directory to copy to. true
toFile string The name of the destination file. If blank, will use the original file's name. Ignored if a fileset is used. false
overwrite string If true, will overwrite the file if it already exists. false
if bool If true, the task will be executed, otherwise it will be skipped. The default is true. False
unless bool The opposite of if. If false, the task will be executed, otherwise it will be skipped. The default is false. False

Nested Elements

fileset

Use to copy multiple files or directories at a time.

filterchain

One or more filters that will modify the file contents after it is copied.

Examples

Example 4.  Includes only blitzmax files in the "src" directory.

<fileset dir="src"> <include name="**/*.bmx" /> </fileset>

Example 5.  Includes images except those with "ignore" in the name

<fileset> <include name="**/*.png" /> <include name="**/*.jpg" /> <include name="**/*.gif" /> <exclude name="*ignore*" /> </fileset>