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

os_file_name(?InternalName, ?ExternalName)

Conversion between internal ECLiPSe file name and Operating System file name syntax.

?InternalName
String, atom or variable.
?ExternalName
String, atom or variable.

Description

This predicate converts between internal (ECLiPSe) and external (operating system) file names. It works in both directions.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Neither InternalName nor ExternalName are instantiated.
(5) Type error
InternalName or ExternalName are instantiated to something other than string or atom.
(5) Type error
InternalName or ExternalName are instantiated to different types.

Examples


Success:
    On UNIX:
      [eclipse]: os_file_name("//a/b/c.def", OS).
      OS = "//a/b/c.def"
      yes

    On Windows:
      [eclipse]: os_file_name("//a/b/c.def", OS), write(OS).
      a:\b\c.def
      OS = "a:\\b\\c.def"
      yes

      [eclipse]: os_file_name(File, "a:\\b\\c.def").
      File = "//a/b/c.def"
      yes

Error:
      os_file_name(X, Y).                          (Error 4).
      os_file_name(4, X).                          (Error 5).
      os_file_name("/home/file", '/home/file').    (Error 5).


See Also

absolute_file_name / 2, pathname / 2, suffix / 2