<< cd files and folders functions diff_file >>

copyfile


Copy files or folder.


Syntax


copyfile(source, destination)
[status, msg] = copyfile(source, destination)
[status, msg] = copyfile(source, destination, 'f')

Input argument


source

a string: file or directory.

destination

a string: file or directory.

'f' or 'F'

force copy even destination is not writable.

Output argument


status

a logical true or false

msg

a string: error message

Description


copyfile(source , destination) copies the file or directory , source (and subdirectories) to the file or directory, destination.

If source is a directory, destination can not be a file.

copyfile replaces existing files without warning.

Example


copyfile([nelsonroot(), '/etc/startup.nls'], [tempdir(), 'startup.nls'])
[status, msg] = copyfile([nelsonroot(), '/etc/startup.nls'], [tempdir(), 'startup.nls'])

See also


isdir, rmfile.

History


Version Description
1.0.0 initial version

Author


Allan CORNET

<< cd files and folders functions diff_file >>