no matter what the path is passed to This.
Code: Select all
loc := Files.dir.This("any string you try");
ASSERT(loc.res = 0);
The documentation says
But notice it has result.res # 0 when the 'locator' is illegal and not when the 'path' is illegal.PROCEDURE (d: Directory) This (IN path: ARRAY OF CHAR): Locator
NEW, ABSTRACT
Returns a locator, given a path name in the host platform's syntax.
This may perform some validity checks, e.g., whether the syntax of the name is correct. Passing the empty string yields a default location (typically the BlackBox directory itself).
Post
result # NIL
result.res = 0
legal locator
result.res # 0
illegal locator
Whenever is the locator illegal?
Motivation:
I had hoped to use Files.dir.This to determine if the folder associated with the path exists.
Because of the above behavior that does not work.
Goal: How do I determine if a folder exists?
-Doug