Copy File to USB slow??
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Copy File to USB slow??
Hello,
If I copy a file of 1.6Mb using COPY FILE to a USB-stick is takes 45seconds.
The same file to the local disk take only 0.05s!!!!
Is there an other function I can use to copy the file?
Thanks,
Marc
If I copy a file of 1.6Mb using COPY FILE to a USB-stick is takes 45seconds.
The same file to the local disk take only 0.05s!!!!
Is there an other function I can use to copy the file?
Thanks,
Marc
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Enrico,
I can't find the copyfile() function.
Vladimir, I have tried it with the fread()/fwrite() functions.
It's much faster (4.7sec) than COPY FILE (45sec), but increasing the buffer doesn't help. It even makes it slower. With a buffer of 1024bytes it takes 4.7sec, a buffer of 20000bytes result in 11.5sec
Regards,
Marc
I can't find the copyfile() function.
Vladimir, I have tried it with the fread()/fwrite() functions.
It's much faster (4.7sec) than COPY FILE (45sec), but increasing the buffer doesn't help. It even makes it slower. With a buffer of 1024bytes it takes 4.7sec, a buffer of 20000bytes result in 11.5sec
Regards,
Marc
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Code: Select all
DLL32 FUNCTION COPYFILE( cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG ) AS BOOL;
PASCAL FROM "CopyFileA" LIB "kernel32.dll"
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
Vladimir, With a buffer of 1024 it takes 4.5sec, With a buffer of 20000 it takes 11.(sec.
I can explain this only the following way. Maybe your program uses a swap file for its virtual memory system. If you request a small block of memory then there is not any need to dwap memory on disk. If you request a large memory block a swap on disk occurs.
It is interesting do you use EMM memory? Try to use EMM memory for your Clipper program and check times anew.
As for Win API function FILECOPY() it does not use Clipper virtual memory. It allocates its own memory for copy operations. So it may be faster. On the other hand I don't know can you use ERROR object with WIN API FILECOPY() function? The Clipper function __FILECOPY() builds ERROR object inside itself.
Vladimir Grigoriev
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
Open your program PROPERTIES by right mouse clicing on the shortcut. On a panel Memory (I am speaking about XP though the same should be in Win 98) there is a dropdown field Expanded (EMS) memory. Change its value from None to 8192.
Then enlarge your buffer, for example, from 1024 to 10240 and repeat testings. One for the 1024 buffer and another for the 10240 buffer.
Vladimir Grigoriev
Then enlarge your buffer, for example, from 1024 to 10240 and repeat testings. One for the 1024 buffer and another for the 10240 buffer.
Vladimir Grigoriev
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
O'k Marc. I was speaking about DOS program all this time but FiveWin program is a Windows program so shortcuts are different for this two types of programs.
Unfortunately I don't know what Virtual Memory Manager is used in FiveWin program. This question should be addressed to Antonio Linares.
Anyway you can write a simple DOS Clipper test program and perform the same operaions for the sake of interest. In this case you will be able to set on or set off EMS memory option on the corresponding shortcut.
Unfortunately I don't know what Virtual Memory Manager is used in FiveWin program. This question should be addressed to Antonio Linares.
Anyway you can write a simple DOS Clipper test program and perform the same operaions for the sake of interest. In this case you will be able to set on or set off EMS memory option on the corresponding shortcut.