Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone know of a way to check for valid path?
Message
 
À
01/03/1999 06:23:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00192165
Message ID:
00192582
Vues:
18
>Drop the ".txt" part and it works. In fact, you could also use other device names like CON, AUX, PRN etc.
>?FILE("C:\NUL")
>
Arne,

That won't work on all networks. Novell, for one, reports that the NULL device is present even for non-existant directories. Ed Raugh has pointed out many of the gotchas with any directory check, mostly related to the fact that even if the directory exists that doen't mean the current user has any rights there.

In VFP we can use the DIRECTORY() function, but I still find it usefull to do something like this;
LOCAL lcError, llNoDir
lcError = ON("ERROR")
ON EORROR llNoDir = .T.
CD (TheDirIWant)
IF llNoDir
   * It doesn't exist
   
ENDIF
IF NOT EMPTY( lcError )
   ON ERROR &lcError
ELSE
   ON ERROR
ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform