Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting current directory
Message
De
08/11/2010 15:36:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01431715
Message ID:
01488545
Vues:
46
>>>>Never trust file()!
>>>>
>>>>?dir('\yourtable.dbf') && Will return true as long as yourtable.dbf is in your path!!
>>>>?adir(temp,'\yourtable.dbf')>0 && Will respect the path specified
>>>>
>>>>
>>>Can you elaborate, please? I tried to reproduce a problem on demand in IDE and I can not.
>>
>>This message contains a big typo, when I meant file(), I accidentally wrote dir().
>>
>>The problem with file() is when you use file() to check for a file in the root (directory or mapping). As long as the file is in the path, VFP will find it even if it's NOT in the root.
>
>Ok, let me try it. You're saying, if we're searching for c:\test.txt and we have file test.txt in the currect folder (in the path) it does return .t. ?
>
>I tried in IDE
>
>file('c:\test.txt') having created the file test.txt in the current directory and it correctly returned .f. I didn't try it in run-time, I tried in IDE.

I just tested myself. I have a file p:\data\kundlist.dbf. ?File('p:\kundlist.dbf') returned .T. since p:\data is in my path, which is WRONG. With blank path the same call returned .F.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform