怎样c语言实现文件的复制,移动,重命名和删除?

2025-04-05 02:01:44
推荐回答(1个)
回答1:

1.复制
BOOL WINAPI CopyFile(
__in LPCTSTR lpExistingFileName,
__in LPCTSTR lpNewFileName,
__in BOOL bFailIfExists
);

2.移动
BOOL WINAPI MoveFile(
__in LPCTSTR lpExistingFileName,
__in LPCTSTR lpNewFileName
);

3.重命名
BOOL WINAPI SetFileShortName(
__in HANDLE hFile,
__in LPCTSTR lpShortName
);

4.删除
BOOL WINAPI DeleteFile(
__in LPCTSTR lpFileName
);