Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone know of a way to check for valid path?
Message
 
To
01/03/1999 06:23:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00192165
Message ID:
00192582
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform