RenameFile
- Updated2023-02-21
- 2 minute(s) read
RenameFile
int RenameFile (char existingFileName[], char newFileName[]);
Purpose
Renames an existing file or a group of existing files.
RenameFile fails if a file already exists with the new filename. If this error occurs after renaming some of the files in a group, this function returns immediately.
RenameFile can rename files across different disk drives. If you specify different disk drives in the parameters, RenameFile copies the source to the target and then deletes the source file.
(Linux) If you specify files on different file systems, RenameFile copies the source to the target and then deletes the source file.
Parameters
Input | ||||
Name | Type | Description | ||
existingFileName | char [] | The pathname of the file to rename. existingFileName can contain wildcard characters ? and *, in which case RenameFile renames all matching files. If you specify an empty string "", RenameFile renames the file found by the most recent call to GetFirstFile or GetNextFile.
|
||
newFileName | char [] | The pathname of the new file name. newFileName can contain wildcard characters ? and *, in which case RenameFile matches the filename to existingFileName.
|
Return Value
Name | Type | Description | ||||||||||||||||||||
result | int | The result of the call.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later