-
Sep 7th, 2024, 09:21 PM
#1
Thread Starter
Addicted Member
App needs to write files from one driveX:\folder to another different driveY:\folder
What methods should I use to get the fastest copy ?
I have many large files I need to copy.
Pass to some external program or use certain APIs with special settings ?
-
Sep 7th, 2024, 10:38 PM
#2
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
You could use lower level APIs but I don't think the API being a few ms faster starting the copy will have any noticeable impact compared to the time it takes the physical disks to read and write. Have you found any programs that copy faster?
-
Sep 8th, 2024, 09:49 AM
#3
Thread Starter
Addicted Member
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
I thought I read decades ago that ...
(1) there is a API fast copy that works on Vista and beyond
(2) that windows does some copy double buffering that can be turned off
(3) that using the correct copy buffers size for read and write related to the disk physical sector size was important
(4) that the size of the copy buffer for read and write is important.
(5) offloading the main app by passing the copy process to say an ActiveX.EXE
How significant are these and other factors ?
-
Sep 8th, 2024, 01:03 PM
#4
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
Find a program that actually copies faster, if one exists, then look at how.
A lot of things that might have mattered for 80s or 90s hardware don't for modern drives.
Maybe if you're trying to copy while under heavy load you could increase the priority of the process/thread above whatever is hogging the CPU/disk.
-
Sep 8th, 2024, 03:56 PM
#5
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
You chould ue an array andd copy the file in blocks I seen a lot of this done in the old Qbasic programs and some were fast. your other option if to write a low level code in C and call it from a dll I am not to sure but you may also ue the api functions WriteFile and ReadFile, or you chould save your self some time and make a pipe to xcopy on windows that does almost what you need and more.
-
Sep 9th, 2024, 02:43 AM
#6
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
I would use CopyFileEx-API within an ActiveX-DLL
1) It would run in its own Thread
2) you could pass the callback via Event back to the calling Program, informing the user about progress
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Sep 9th, 2024, 11:10 AM
#7
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
Dont need an activex exe for something like that, just The trick's multithreading module. (Or of course, tB is thread safe and requires no hacks to call CreateThread)
-
Sep 9th, 2024, 02:09 PM
#8
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
Being thread-safe doesn't mean much, synchronization is still a major pitfall of threading. By comparison, ActiveX EXEs are a breeze.
-
Sep 9th, 2024, 03:15 PM
#9
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
This isn't many threads trying to coordinate the same task, it's just a single thread spun up for a single task.
Maintaining a whole separate exe, active x no less, isn't really optimal imo. Most of us get by with a DoEvents to update the GUI and check for cancel clicks in the copy callback.
-
Sep 9th, 2024, 07:11 PM
#10
Re: App needs to write files from one driveX:\folder to another different driveY:\fol
One question that isn't clear to me ... are these files being copied from the same "box", just different drives, or:
- Are they being copied from different drives or folders on a server?
- Are they being copied from two entirely different "boxes", possibly locally-to-server (or vice-versa)?
The answers to those questions can make a very large difference for the correct answer to your question.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|