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

getcwd(?Cwd)

Unifies the current working directory with Cwd.

?Cwd
String or Variable.

Description

Cwd is unified with the current working directory including the final "/".

Equivalent to get_flag(cwd, Cwd). To set the current working directory, use set_flag(cwd, Directory) or cd(Directory).

Fail Conditions

Fails if Cwd does not unify with the current working directory

Resatisfiable

No.

Exceptions

(5) Type error
Cwd is instantiated but not to a string.

Examples


Success:
     [eclipse]: sh(pwd).
     /home/user/test
     yes.
     [eclipse]: getcwd(Cwd).
     Cwd = "/home/user/test/"
     yes.

Fail:
    getcwd("nodirectory").

Error:
      getcwd(1).           (Error 5).
      getcwd(atom).        (Error 5).


See Also

cd / 1, get_flag / 2, set_flag / 2, mkdir / 1