FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour About copyfile: checking results
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About copyfile: checking results
Posted: Thu Jun 12, 2008 08:05 AM

Hi,
I use in my app (FWH 8.05) the function CopyFile (<orig.file>,<dest.file>,.f.) to make a backup of some archive files.

The problem is that I have a customer where some files are (randomly) not copied. I cheked that copyfile return (.f.) on those files so an error occurred.

I would like have an extended error code (like ferror() to be clear) in order to know the origin of this problem. Is it possibile to make this using copyfile or is there any other copy function with an extended error code manager that can I use ?

Thanks.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
About copyfile: checking results
Posted: Thu Jun 12, 2008 09:08 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 09:05 AM

I tracked the COPYFILE function errors using GetLastError()
and an 1006 error appairs randomly copying files from an hard disk to a pen drive.

This is the Microsoft error code:

ERROR_FILE_INVALID
1006
0x3EE
The volume for a file has been externally altered so that the opened file is no longer valid.


Is there anyone that already had this error copying data on a pen drive ?
Any ideas ?

Thanks.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 09:50 AM
I use CopyFile() intensively to copy from hard disk to USB devices and never noticed any problems. This is the CopyFile() definition I'm using:

DLL32 FUNCTION COPYFILE( cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG ) AS BOOL;
      PASCAL FROM "CopyFileA" LIB "kernel32.dll"


EMG
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 10:58 AM
Enrico Maria Giordano wrote:I use CopyFile() intensively to copy from hard disk to USB devices and never noticed any problems. This is the CopyFile() definition I'm using:

DLL32 FUNCTION COPYFILE( cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG ) AS BOOL;
      PASCAL FROM "CopyFileA" LIB "kernel32.dll"


EMG


Hi Enrico, thanks for your reply.

I am using the standard copyfile provided from FWH and the DLL32 code is the same.

I think it could be an OS/Hardware issue due to the fact that I also have a lot of customers that never reported me this problem but I would like give a suggest to this customer in order to solve/bypass this problem.
Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 11:08 AM

Sorry, I can't imagine why a simple API would GPF...

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 11:24 AM

Enrico,

It seems as there is no a GPF but an error returned code.

Marco, maybe you could try it for n times, in case that another try is able to do it.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 11:36 AM

Ops! :-)

EMG

Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 12:03 PM
Antonio Linares wrote:Enrico,

It seems as there is no a GPF but an error returned code.

Marco, maybe you could try it for n times, in case that another try is able to do it.


Yes,
in the meantime I asked the customer to format this pen drive
and if the problem still remains I will try the copyfile 3 times before to stop the routine and display the error code.

Thanks to all.
Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 05:41 PM

Marco,

You might also suggest that your customer try another pen drive--the one they are using could be defective.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
About copyfile: checking results
Posted: Fri Jun 20, 2008 07:22 PM
Marco,

I had a problem with USB drive on my VISTA PC, too.
http://forums.fivetechsoft.com/viewtopi ... 41&start=0

What is ISREADY( cDrive ) returning?
Here it errored out with this error screen. As a solution I deinstalled all the USB ports and drivers and installed the USB ports again.

Regards,
Otto



Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
About copyfile: checking results
Posted: Sat Jun 21, 2008 09:14 AM

Otto,

Have you located what exact function call is generating the GPF ? thanks,

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
About copyfile: checking results
Posted: Mon Jun 23, 2008 06:39 PM

Hello Antonio,
I am sorry but I don't have done more tests as I reported in the thread.
Now as I have reinstalled the USB ports I can't reproduce the error.

Regards,
Otto

Continue the discussion