Information générale
Catégorie:
Codage, syntaxe et commandes
If no directory is specifed or the searched file is at the root (in your case), File() will look in all paths set with SET PATH. You can argue weither it's a bug or a feature, but I'm sure that MS think that it's a feature.
ADir() will do what you want to do.
>I have the same problem, although I'm getting different results.
>If I use File("A:\mastco.dbf") I get a result of .T., since the file is found along the VFP path. I've also tried File("c:\mastco.dbf") and File("D:\mastco.dbf") {a Zip drive}.
>
>I'm working on a backing up process that can be put in the root of A: or D:, or a network drive (f:\ is actually a sub-directory, but mapped as a drive). The backup set can't be located in any valid data directory, so I need this to work. I can use if adir("A:\mastco.dbf") <> 0 or lcText=locFile("A:\mastco.dbf") and compare lcText with the path I send, but I get really tired of writing around VFP.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement