[ ECLiPSe Operating System built-in.|Group Index| Full Index]

absolute_file_name(+RelName, ?FullName)

Expands a relative or symbolic file name into a full file path name.

+RelName
String or atom.
?FullName
String, atom or variable.

Description

This predicate expands a relative or symbolic file name into a full absolute file path name: Relative file name are prefixed with the current directory. A leading tilde character is replaced with the user's home directory. A symbolic file specifications like library(x) is replaced by the full path name where the library file can be found.

FullName is always of the same type (string or atom) as RelName.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
RelName is not instantiated.
(5) Type error
RelName or FullName are instantiated to something other than string or atom.

Examples


Success:
      [eclipse]: absolute_file_name("file", Full).
      Full = "/homes/tom/file"
      yes

      [eclipse]: absolute_file_name(file, Full).
      Full = '/homes/tom/file'
      yes

      [eclipse]: absolute_file_name("~/file", Full).
      Full = "/homes/tom/file"
      yes

      [eclipse]: absolute_file_name(library(fd), Full).
      Full = '/usr/local/eclipse/lib/fd.sd'
      yes

Error:
      absolute_file_name(X, Y).                          (Error 4).
      absolute_file_name(4, X).                          (Error 5).


See Also

os_file_name / 2, pathname / 2, suffix / 2