第十一节 文件操作

tech2022-07-15  140

文件操作

在Windows中有几个关于文件操作的API函数

DeleteFile CopyFile MoveFile win32api.DeleteFile DeleteFile(fileName) Deletes the specified file. Parameters fileName : string/PyUnicode File to delete. Win32 API References Search for DeleteFile at msdn, google or google groups. win32api.CopyFile CopyFile(src, dest, bFailOnExist) Copies an existing file to a new file Parameters src : stringPyUnicode Name of an existing file. dest : string/PyUnicode Name of file to copy to. bFailOnExist=0 : int Indicates if the operation should fail if the file exists. Win32 API References Search for CopyFile at msdn, google or google groups. win32api.MoveFile MoveFile(srcName, destName) Renames a file, or a directory (including its children). Parameters srcName : string The name of the source file. destName : string The name of the destination file. Comments This method can not move files across volumes. Win32 API References Search for MoveFile. at msdn, google or google groups.
最新回复(0)