Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if file exists only in a particular place
Message
De
07/10/2007 14:37:27
 
 
À
06/10/2007 19:23:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01258744
Message ID:
01259271
Vues:
22
>
>No. In this case file(...) and !empty(sys(2000), ...) are doing the same thing. Toss a coin and choose one.
>Cetin

File() may have some problems that sys(2000.. may not have. I think that sys(2000 is be just a wrapper to FindFirstFile and FindNextFile, so it should work under all circumstances.

File() has problems when the path does not include any folders, or if you use an UNC path, and may give false positives.
m.lcDefault = Set("DEFAULT")
m.lcPath = Set("PATH")

Mkdir C:\TEST001
Mkdir C:\TEST001\TEST002

Set Default To C:\TEST001
Set Path To C:\TEST001\TEST002

m.lcFoo = "12345678"

Strtofile(m.lcFoo, "c:\test001\test002\test003.txt")

?'File("test003.txt")', File("test003.txt")
?'File("c:\test001\test003.txt")', File("c:\test001\test003.txt")
?'File("c:\test003.txt")', File("c:\test003.txt")
?'File("\\someserver\somefolder\test003.txt")', File("\\someserver\somefolder\test003.txt")

Chdir (Home(0))

Delete File "c:\test001\test002\test003.txt"
Rmdir C:\TEST001\TEST002
Rmdir C:\TEST001

Set Default To (m.lcDefault)
Set Path To (m.lcPath)
Carlos Alloatti
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform