下面这个函数可以实现拷贝并重命名 BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file LPCTSTR lpNewFileName, // pointer to filename to copy to BOOL bFailIfExists // flag for operation if file exists );
The MoveFile function renames an existing file or a directory (including all its children). BOOL MoveFile( LPCTSTR lpExistingFileName, // address of name of the existing file LPCTSTR lpNewFileName // address of new name for the file );
sprintf(renamefile,"rename %s %s",file1,file2);
system(rename);
就可以实现重命名。
DeleteFile
BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
The MoveFile function renames an existing file or a directory (including all its children). BOOL MoveFile( LPCTSTR lpExistingFileName, // address of name of the existing file
LPCTSTR lpNewFileName // address of new name for the file
);
注意renames an existing file or a directory