Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY FILE Foo?
Message
De
05/04/2004 22:00:19
 
 
À
05/04/2004 14:55:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00892383
Message ID:
00892494
Vues:
23
It appears you were right on the money. I first wrote in a logging function that showed me that most, if not all, the errors were occuring on files included in the project. This was such a simple program that I was able to take out all references to external classes, reports, bitmaps, etc., and recompile it from a single .prg file. So no external files at all were inlcluded in the executable.

Lo and behold, it ran without any errors and copied all relevant files. So COPY FILES apparently looks internally first without reference to path, even though the file name argument includes full path name information. I can think of cases where this behavior might be useful, but it sure wasn't here.

Another point of interest: the path apparently is completely ignored, because the file with exactly the same path as the original on the development machine (C drive) in fact did exist on the file server. That would have been the destination target for the backup routine. The executable, however, was running in a different directory, and the file did not exist there.

Thanks again for your timely assistance.

>I'd like to hear your results.
>
>>Well, Tore, this is a better explanation than anything I'd been able to come up with. I'll do some more experimenting. Thanks.
>>
>>>I may be wrong, but I think I read somewhere that some commands, COPY TO may be one of them, does not respect the path of a file, if a file with the same name is 'baked' into the exe, the 'baked in' file will be used instead.
>>>
>>>>Interesting shot :-). Yes. But... The executable is running on a file server with a path name to a mapped drive letter "R" that looks back at the development machine where the source file actually exists--on the C drive, i.e., C is mapped as R on the machine where the executable runs (this is a home grown backup app). So the file stored in the project shouldn't have the same full path name. Am I overlooking something?
>>>>
>>>>>Just a shoy in the dark. Do you also have a file called ADD.BMP added to your project?
>>>>>
>>>>>>Anybody seen this?
>>>>>>
>>>>>>
>>>>>>LOCAL ;
>>>>>>   lcFile,;
>>>>>>   laSrc[1]
>>>>>>
>>>>>>lcFile = "C:\PROJECTS\COMMON\ADD.BMP"
>>>>>>
>>>>>>IF ADIR(laSrc,lcFile) > 0
>>>>>>   COPY FILE (lcFile) TO <destination>
>>>>>>ENDIF
>>>>>>
>>>>>>
>>>>>>And the COPY FILE line throws an error 1, "File does not exist"--ONLY in compiled executable (.exe with Fox runtime only) but runs just fine from source code? (I started out using IF FILE(lcFile) but changed that thinking it might be the source of the problem. Changing to ADIR() made no difference.) BTW, the file DOES exist.
Ray Roper
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform