About copyfile: checking results

Post Reply
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

About copyfile: checking results

Post by Marco Turco »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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:

Code: Select all

DLL32 FUNCTION COPYFILE( cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG ) AS BOOL;
      PASCAL FROM "CopyFileA" LIB "kernel32.dll"
EMG
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

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:

Code: Select all

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Marco,

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

James
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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



Image
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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
Post Reply