All ECLiPSe built-ins that take file names as arguments accept absolute pathnames as well as relative pathnames starting at the current directory.[eclipse 1]: getcwd(Where). Where = "/usr/name/prolog" yes. [eclipse 2]: cd(..). yes. [eclipse 3]: get_flag(cwd, Where) Where = "/usr/name" yes.
[eclipse 1]: read_directory("/usr/john", "*", Dirlist, Filelist). Dirlist = ["subdir1", "subdir2"] Filelist = ["one.c", "two.c", "three.pl", "four.pl"] yes.
C:
is
indicated by //C/
, so a Windows filename such as
"C:\my\path\name.ecl"
should be writen as
"//C/my/path/name.pl"
. The utility os_file_name/2 provides for
the interconversion between the format used in ECLiPSe and the Operating
Systems' format. ~
, ~
user
or $var.
[eclipse 1]: Name = "~octopus/prolog/file.pl", pathname(Name, Path, File, Suffix). Path = "/usr/octopus/prolog/" File = "file.pl" Name = "~octopus/prolog/file.pl" Suffix = ".pl" yes.