About copyfile: checking results

About copyfile: checking results

Postby Marco Turco » Thu Jun 12, 2008 8: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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Postby Antonio Linares » Thu Jun 12, 2008 9:08 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marco Turco » Fri Jun 20, 2008 9: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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Postby Enrico Maria Giordano » Fri Jun 20, 2008 9: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:

Code: Select all  Expand view  RUN
DLL32 FUNCTION COPYFILE( cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG ) AS BOOL;
      PASCAL FROM "CopyFileA" LIB "kernel32.dll"


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Marco Turco » 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:

Code: Select all  Expand view  RUN
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
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Postby Enrico Maria Giordano » Fri Jun 20, 2008 11:08 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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


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

Postby James Bott » Fri Jun 20, 2008 5:41 pm

Marco,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Otto » Fri Jun 20, 2008 7: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



Image
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Sat Jun 21, 2008 9:14 am

Otto,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Mon Jun 23, 2008 6: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
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests