[Index]

copy


A Copy job. Copy either:

Property Summary

directoriesCopied The number of directories copied.
filesCopied The number of files copied.
from The from file.
input An input.
name A name, can be any text.
output The output.
to The from file.

Example Summary

Example 1 Copy a file.
Example 2 Copy a directory.
Example 3 Copy from a file to a buffer.

Property Detail

directoriesCopied

AccessREAD_ONLY
RequiredRead Only.

The number of directories copied.

filesCopied

AccessREAD_ONLY
RequiredRead Only.

The number of files copied.

from

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes unless input supplied.

The from file.

input

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes unless from supplied.

An input.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

output

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes unless to supplied.

The output.

to

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes unless output supplied.

The from file.


Examples

Example 1

Copy a file.

<oddjob id="this">
    <job>
        <copy to="${work.dir}">
            <from>
                <file file="${base.dir}/test/io/reference/test1.txt"/>
            </from>
        </copy>
    </job>
</oddjob>

Example 2

Copy a directory.

<oddjob id="this">
    <job>
        <copy to="${work.dir}">
            <from>
                <file file="${base.dir}/test/io/reference/a"/>
            </from>
        </copy>
    </job>
</oddjob>

Example 3

Copy from a file to a buffer.

<oddjob id="this">
    <job>
        <sequential>
            <jobs>
                <copy name="Copy from a file to a buffer">
                    <from>
                        <file file="${this.args[0]}/test/io/reference/test1.txt"/>
                    </from>
                    <output>
                        <identify id="buff">
                            <value>
                                <buffer/>
                            </value>
                        </identify>

                    </output>
                </copy>
                <echo id="e" name="What's in the file?">${buff}</echo>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present