copyfile
Copy file or folder
Syntax
Description
copyfile
copies the file or folder
source
source
to the current folder. After a successful
copyfile
operation, the timestamp for the new file is the
same as the timestamp for source
.
copyfile
copies source
destination
source
to the file or folder
destination
.
If
source
is a file, thendestination
can be a file or folder.If
source
is a folder, thendestination
must be a folder.If
source
is a folder or specifies multiple files anddestination
does not exist, thencopyfile
attempts to createdestination
.
copyfile
copies source
destination
fsource
to destination
,
even when destination
is not writable. The state
of the read/write attribute for destination
does
not change.
copyfile(
specifies whether to copy a symbolic link or its target. (since R2024b)source
,destination
,CopyLinkBehavior=slbehavior
)
copies the
specified file or folder and returns a status of status
= copyfile(___)1
if the
operation is successful. Otherwise, copyfile
returns
0
. You can use this syntax with any of the input argument
combinations in the previous syntaxes.
Examples
Input Arguments
Output Arguments
Limitations
MATLAB® does not support internet URLs that require authentication.
MATLAB Online™ supports internet URLs associated with Microsoft® OneDrive™ files and folders, while the installed version of MATLAB supports only local OneDrive files.