Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FOPEN, FTIME and FILE COPY versus FULLPATH, is it a BUG
Message
From
20/06/2000 01:19:27
 
 
To
19/06/2000 18:55:05
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00381795
Message ID:
00382066
Views:
17
>Dear Mike,
>
>thank you for your answer! Well, in most cases you are absolutely right. But...
>I want to write a general copy program. I don't know which files will be copied with my program!
>I donnot understand why Copy File fails to understand the path portion in file names. Your explanation is right, if I miss the path. But I provide the fullpath to the functions (FOPEN, FTIME, FILE COPY).
>Anyway, documentation states, that these functions understand the fullpath in filenames!
>

Bela, a workaround that I've found is to use a non-VFP equivalent operation - my usual practice is to use the functionality in the Scripting.FileSystemObject automation object from the WSH, since it offers all the same operations and has no clue about the internal members of the VFP executable. Perhaps not elegant, but it works, and since I always install it with my apps, can use the WSH COM objects reliably; my launcher inspects the workstation's components and installs the self-extracting executable if it doesn't find it, or finds that there's a newer version sitting in the app component repository. The scripting and COM objects which come with WSH are just too valuable for exposing Win services and handling common tasks not to install them. I add ActiveX controls to my forms which do much less and are at least as big a pain to install! Before too long,I may standardize installation of ADSI...at which point, look for signs of the pending Armageddon...

>bb
>
>P.S.: I workarounded the problem by using CopyFile api function.
>

CopyFile() is a tremendous aid; the entry in the FAQ on using it to send to a printer is a good start point for people who want to play.

>>>If you try to fopen, ftime or file copy any file with qualified fullpath (!) >that has the same name that an included file, this exe will use the included >file not the specified one.
>>
>>By design. Why? Well, if you're like most developers, you don't keep all of your PRGs, menus, forms, etc. in one directory. No, in order to keep them organized, you might have a .\PRG directory, a .\Menus directory, etc. But when you test before compiling, you need to reference the at least the ".\prg" part of the pathname to find the file you want. However, if Fox didn't have the behavior you describe, you'd have to strip out the path names once you compile to an EXE or APP.
>>
>>The solution to your problem is to exclude the files in the project.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform