<?xml version="1.0"?>

<!--
	description:

		"Copy Tasks"

	library: "Gobo Eiffel Ant"
	copyright: "Copyright (c) 2002, Sven Ehrke and others"
	license: "Eiffel Forum License v2 (see forum.txt)"
	date: "$Date: 2005/07/07 13:34:12 $"
	revision: "$Revision: 1.7 $"
-->

<chapter xmlns="http://www.gobosoft.com/eiffel/gobo/documentation" id="copy_task">
<chapterinfo>
	<copyright>
		<year>2002-2005</year>
		<holder>Sven Ehrke</holder>
	</copyright>
	<author>
		<firstname>Sven</firstname><surname>Ehrke</surname>
	</author>
	<email>ericb@gobosoft.com</email>
	<date>7 July 2005</date>
</chapterinfo>

	<title>copy</title>

	<section id="copy_description">
		<title>Description</title>
		<para>
			Copy a file or fileset to a new file or directory. Files are only copied if the source file
			is newer than the destination file, or when the destination file does not exist.
		</para>
	</section>

	<section id="copy_parameters">
		<title>Parameters</title>

		<variablelist>
			<varlistentry>
				<term>file</term>
				<listitem>
					<para><emphasis>Description: </emphasis>File to be copied</para>
				</listitem>
				<listitem>
					<para><emphasis>Domain: </emphasis>Valid filename pointing to existing file</para>
				</listitem>
				<listitem>
					<para><emphasis>Default: </emphasis>-</para>
				</listitem>
			</varlistentry>

			<varlistentry>
				<term>to_file</term>
				<listitem>
					<para><emphasis>Description: </emphasis>File to copy to</para>
				</listitem>
				<listitem>
					<para><emphasis>Domain: </emphasis>Valid filename</para>
				</listitem>
				<listitem>
					<para><emphasis>Default: </emphasis>-</para>
				</listitem>
			</varlistentry>

			<varlistentry>
				<term>to_directory</term>
				<listitem>
					<para><emphasis>Description: </emphasis>Directory to which file(s) should be copied to</para>
				</listitem>
				<listitem>
					<para><emphasis>Domain: </emphasis>Valid directoryname pointing to existing directory</para>
				</listitem>
				<listitem>
					<para><emphasis>Default: </emphasis>-</para>
				</listitem>
			</varlistentry>

			<varlistentry>
				<term>force</term>
				<listitem>
					<para>
						<emphasis>Description: </emphasis>Copy file even when the
						possibly existing target file is not out of date.
					</para>
				</listitem>
				<listitem>
					<para><emphasis>Domain: </emphasis>Boolean (true|false)</para>
				</listitem>
				<listitem>
					<para><emphasis>Default: </emphasis>false</para>
				</listitem>
			</varlistentry>
		</variablelist>
	</section>

	<section id="copy_specification">
		<title>RNG Specification</title>

		<programlisting><![CDATA[
  <define name="copy">
    <element name="copy">
      <ref name="dir_if_unless"/>
        <choice>
          <group>
            <attribute name="file"/>
            <attribute name="to_file"/>
          </group>
          <group>
            <attribute name="file"/>
            <attribute name="to_directory"/>
          </group>
          <group>
            <attribute name="to_directory"/>
            <ref name="fileset"/>
          </group>
        </choice>
      <optional>
        <attribute name="force">
          <!-- runtime evaluation
          <choice>
            <value>true</value>
            <value>false</value>
          </choice>
          -->
        </attribute>
      </optional>
    </element>
  </define>
]]>
	</programlisting>
	</section>

	<section id="copy_examples">
		<title>Examples</title>
	<programlisting><![CDATA[
  <copy file="readme.txt" to_file="readme1.txt"/>

  <copy file="readme.txt" to_directory="/tmp"/>

  <copy to_directory="/tmp">
    <fileset directory="kernel" include="@(**/*.ge)"/>
  </copy>
]]>
	</programlisting>
	</section>

</chapter>
