moveFile
R2026bSyntax
Description
moves the files or folders specified in the entries = moveFile(proj,source,destination)source argument into the
destination specified in the destination argument. The destination must
not contain an existing file or folder with the same name as the source. If a name conflict
occurs, the function throws an error. You can move items within a project, into a project,
or out of a project. The function allows you to move or rename files or folders depending on
the values of the source and destination arguments:
To move a folder inside another folder, specify both the
sourceanddestinationarguments as folder paths. The destination folder must exist. If the destination folder does not exist, the function renames the source folder instead. If the destination folder does not exist and is outside the root folder of the project, the function moves the source folder to the specified destination and renames it.To move a file inside a folder, specify the
sourceargument as a file and thedestinationargument as a folder. If the destination folder does not exist, the function renames the source file instead. If the destination folder does not exist and is outside the source folder location, the function moves the source file to that location and renames it.
The moveFile function updates the source control status and the
project definition files impacted by the move.
specifies additional options as one or more name-value arguments.entries = moveFile(proj,source,destination,Name=Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Version History
Introduced in R2026b
See Also
listImpactedFiles | listRequiredFiles | currentProject | openProject