>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
ENDIF
IF NOT EMPTY( lcError )
ON ERROR &lcError
ELSE
ON ERROR
ENDIF