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

pathname(+FilePath, ?Path)

Succeeds if the pathname FilePath, if stripped of its file name, gives Path, the path up to the parent directory of the file.

+FilePath
String or atom.
?Path
Variable or string.

Description

Used to check if the pathname FilePath, when stripped of its file name, unifies with Path, the path up to the parent directory of the file. pathname(File, Path) is equal to pathname(File, Path, _).

Fail Conditions

Fails if the pathname FilePath, when stripped of its file name, does not unify with Path, the path up to the parent directory of the file.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
FilePath is not instantiated.
(5) Type error
FilePath is not a string or atom.
(5) Type error
Path is neither a string nor a variable.

Examples


Success:
      [eclipse]: pathname("/home/user/userfile", P).
      P = "/home/user/"
      yes.

      pathname("/home/user","/home/").
      pathname("/home/","/home/").
      pathname("/home","/").
      pathname("/","/").

Fail:
      pathname("/home/","/").

Error:
      pathname(F,P).                   (Error 4).
      pathname('/home/user/',P).       (Error 5).


See Also

pathname / 3, suffix / 2