MATLAB Function Reference    
copyfile

Copy file

Graphical Interface

As an alternative to the copyfile function, you can copy files using the Current Directory browser. To open it, select Current Directory from the View menu in the MATLAB desktop.

Syntax

Description

copyfile source dest copies the file, source, to directory or file, dest. The source and dest arguments may be absolute pathnames or pathnames relative to the current directory. The pathname to dest must exist, but dest cannot be an existing filename in the current directory.

copyfile source dest writable makes the destination file writable following the file copy.

status = copyfile('source','dest',...) returns a status of 1 if the file is copied successfully and 0 otherwise.

[status,msg] = copyfile('source','dest',...) returns status and a nonempty error message string when an error occurs.

Example

To make a copy of a file in the same directory,

To copy a file to another directory, keeping the same filename,

See Also

delete, mkdir


 convn copyobj