Move Function

Owning Palette: Advanced File VIs and Functions

Requires: Base Development System

Moves the file or directory that you specify in source path to the location that you specify in target path. If you move a directory, this function moves all the contents of the directory recursively to the new location. You cannot use this function to move files into or out of an LLB.

 Add to the block diagram  Find on the palette
prompt is the message that appears above the list of files and directories, or folder, in the file dialog box.
source path specifies an absolute path to the file or directory on which you want to operate. If you specify an empty or relative path, this function returns an error.
target path is the new absolute path for the file or folder on which you want to operate, including the new file or folder name. You must have write permission for the file or directory that you specify in target path; otherwise, this function does not move the file or directory and returns an error.
Tip  Use the Set Permissions function to set the permissions for a file or directory.
You must ensure the target path exists before running this function. If the last component of the target path does not exist, this function renames the file or folder you specified in the source path to this component name and moves the file or folder to the target location. See the examples below for details. If target path is empty (default), the function displays a dialog box from which you can select a file or folder. If you specify an empty or relative path, this function returns an error.

Example: moving the source folder on C drive to the dest folder on D drive.
Input/Output Value Notes
source path C:\source
target path D:\dest
new path D:\dest\source If the dest folder in target path exists, this function moves the source folder to the dest folder.
D:\dest If the dest folder in target path does not exist, this function renames the source folder to dest and then moves all the source folder contents to the dest folder.


Example: moving the test.txt file under C:\source to the dest folder on D drive.
Input/Output Value Notes
source path C:\source\test.txt
target path D:\dest
new path D:\dest\test.txt If the dest folder in target path exists, this function moves the test.txt file to the dest folder.
D:\dest If the dest folder in target path does not exist, this function renames the test.txt file to dest and then moves this file to D drive.
overwrite determines whether the function replaces existing files or folders in the target path. If you overwrite a folder that contains unique files, LabVIEW moves those files to the new folder. (macOS and Linux) LabVIEW does not overwrite read-only files, even if you set this parameter to TRUE.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
new path specifies the new location of the file or directory. If the operation is unsuccessful, this function sets new path to <Not A Path>.
cancelled is TRUE if you cancel the file dialog box. Otherwise, cancelled is FALSE, even if this function returns an error.
error out contains error information. This output provides standard error out functionality.