core/builtins/cp.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Wed, 13 Oct 2010 12:41:05 +0100
changeset 66 2a78c4ff2eab
parent 0 7f656887cf89
permissions -rw-r--r--
Migrated ciftest and various fixes from FCL to MCL.

# cp.cif
# 
# Copyright (c) 2010 Accenture. All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
# 
# Initial Contributors:
# Accenture - Initial contribution
#

==name cp

==short-description

Copy one or more files or folders.

==long-description

If source is a directory and --recurse is used, destination is assumed to be a directory. If C<destination> exists, C<source> is copied into it, giving the directory structure C<destinationdir\sourcename\...>. This is in line with how posix cp behaves, but it is different to the default Symbian CFileMan behaviour, which would put the files in sourcedir directly into destinationdir without creating a directory called sourcename. In posix cp terms, CFileMan usually performs C<cp -r source\* destination\> instead of C<cp -r source destination>. If C<destination> does not exist, it is created, and posix cp and CFileMan behave the same in this case. It is considered preferable for fshell cp to behave the same as posix cp, rather than following CFileMan's behaviour.

Because of the above behavioural ambiguity (and other strangenesses in CFileMan) it is not recommended to copy a directory without specifying the --recurse option.

Note, also aliased to C<copy>.

==argument filename source

The name of the source file (may contain wild characters) or directory.

==argument filename destination

The name of the destination file or directory.

==option bool r recurse

Copy matching files in sub-directories. Creates any missing directories in the destination path.

==option bool o overwrite

Overwrite file at destination, if it exists.

==option bool f force

Forcibly copy, even if the file is in use. Note, this option can't be used with --recurse.

==copyright

Copyright (c) 2006-2010 Accenture. All rights reserved.