Re: How to Copy/Move/Delete files
Posted by webmaster Guido on June 19, 2000 at 15:56:43: In Reply to: How to Copy/Move/Delete files posted by Leox, again :) on June 19, 2000 at 15:53:04: : How do I Copy/Move/Delete files? Thanks again :) To copy a file, use this WinApi function, which returns TRUE if the file is copied:
CopyFile(
Example:
To delete a file, simply use the Delphi function DeleteFile(const FileName: string): Boolean; Moving a file: first copy it, then delete the original file. The DClub Libary contains some wrappers for the functions to copy and to move files. These functions also return messages that show if the operation succeeded, and if not, what went wrong (because in a MOVE two things can go wrong: copying the file, but also deleting the original file).
|
|