Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY FILE adds folder to path
Message
De
03/03/2021 16:31:00
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
03/03/2021 15:59:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01678721
Message ID:
01678730
Vues:
43
>>Let me start by saying we've found a workaround, so I'm posting this because I want to know the answer, not because I need a solution.
>>
>>A vertical market application I'm working on has a routine that copies a couple of files from one folder to another, changing the name in the process. It's been working for quite some time, but last week, some (but not all) users started having problems. The error log shows that there's an extra folder in the path for the source file. That is, there's a variable with a value like:
>>
>>
>>C:\MyFolder\MyFile.FRX
>>
>>
>>When COPY FILE is handed this variable, the error message says it can't find:
>>
>>
>>C:\MyFolder\Reports\MyFile.FRX
>>
>>
>>In trying to track this down this morning, we actually replaced the variable with a hard-coded path to the file, so the command was like:
>>
>>
>>COPY FILE C:\MyFolder\MyFile.FRX TO C:\MyOtherFolder\MyOtherFile.FRX
>>
>>
>>We still got an error that showed Reports in the path.
>>
>>What can I add? These aren't actually on C; the folders are on a mapped drive. The source file exists and we have no problem copying it via Explorer.
>>
>>As I said, we've found a work-around. We're using the CopyFile API function and it works as expected.
>>
>>Anybody have a clue what would cause this?
>>
>>Tamar
>
>My first idea was #Define, but then I saw that this also happened with hard-coded paths. Beats me... :-)

Why? Hard coded works perfectly with defines ...
#DEFINE YourFolder MyFolder

CLEAR
mkdir  MyFolder
strtofile('BlaBlub','MyFolder\bla.txt')
COPY FILE MyFolder\bla.txt TO YourFolder\Blub.txt
?filetostr('MyFolder\blub.txt')+filetostr([YourFolder\blub.txt])
?file('MyFolder\blub.txt')
?file('MyFolder\bla.txt')
DELETE FILE YourFolder\*.txt 
RMDIR YourFolder
Nothing wrong with it

Aunt Edit: Added [] string operation
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform