[ Operating System | Reference Manual | Alphabetic 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.

Modes and Determinism

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

existing_file / 4, pathname / 4