Delphi copy file




















Can you tell me how to copy file s to the clipboard 2. Copying files - Traping file sharing error 3. File Access Denied after copying file 4. Copying files across a Network Files Help!! Update 6. Copy file from Temporary internet files 7. Deleting and copying files - file error 8. Copy file vs Move file via Clipboard Copying files to the temporary internet files folder. I want the name to stay the same just change directories.

On modern Delphi IOUtils unit has cross platform functionality for file copying. Why don't you read the documentation? Have you done that yet? Does it describe how errors are signaled. Show 4 more comments. Cross-platform solution uses System. IOUtils; TFile. Copy 'file. Two methods, the first is the simplest while the 2nd has a bit more error checking.

Message ; End; End; End; Method 1 copies the file from Oldname to Newname and displays a message indicating success or failure. Method 2 does the same but will trap exceptions raised just in case everything turns to custard. All of your error handling is completely bogus. All of it. DavidHeffernan It's simplistic, I agree, but how is it bogus?

Tested with Delphi 7 which I use and it worked - unless I was having a bad typing day. Can you be more specific? For example: procedure TsomeForm. For example: uses ActiveX, Winapi. ShlObj, System. Create; OleCheck pfo. PerformOperations ; pfo. Improve this answer. Remy Lebeau Remy Lebeau k 29 29 gold badges silver badges bronze badges. Remy Lebeau - Thank you for an incredibly well-written and detailed answer, I'll definitely give it a go!

Dsm Dsm 5, 18 18 silver badges 24 24 bronze badges. Using FileExists in this manner is a race condition. Here is my take on a solution procedure TsomeForm.

Jan Lauridsen Jan Lauridsen 4 4 silver badges 9 9 bronze badges. Sign up or log in Sign up using Google. Collectives on Stack Overflow. Learn more. Copying lots of files in Delphi Ask Question. Asked 12 years, 3 months ago. Active 12 years, 2 months ago. Viewed 7k times. Improve this question. Jim McKeeth Charles Faiga Charles Faiga The disk heads have to move a lot to look for files and to find free space to copy them.

If you copy those files from the command line, is the system much faster?



0コメント