![]() |
|
Navigation |
Synopsis A requested path name cannot be found.
Function
data RunTimeException = PathNotFound(loc location);
Usage
import Exception;
Description The
PathNotFound error is generated in all cases where access to the requested location is impossible.
This includes:
Examples
rascal>import IO;
ok
Reading a non-existing URI gives an error:
rascal>readFile(|http://www.cwi.nl/does_not_exist|);
|stdin:///|(9,34,<1,9>,<1,43>): PathNotFound(|http://www.cwi.nl/does_not_exist|)
at *** somewhere ***(|stdin:///|(9,34,<1,9>,<1,43>))
at readFile(|stdin:///|(9,34,<1,9>,<1,43>))
Trying to write to a file for which we do not have write access (don't run this as superuser!) als gives an error:
rascal>writeFile(|file:///etc/passwd|, "A BAD idea!");
|stdin:///|(32,13,<1,32>,<1,45>): PathNotFound(|file:///etc/passwd|)
at *** somewhere ***(|stdin:///|(32,13,<1,32>,<1,45>))
at writeFile(|stdin:///|(32,13,<1,32>,<1,45>))
![]() |