OS:HostPath

Operating systems differ in the syntax of file names and paths.

Unix paths are simple and systematic. The "/" symbol separates path elements. Paths with a leading separator are absolute; otherwise the path is relative to the user's current working directory.

Paths in Microsoft Windows are more problematic. Typically "\" is used as a path separator, but "/" is also permitted. Paths with a leading separator are relative to the user's current working drive. Paths with a leading drive specifier may be absolute or relative. For example, "C:\test" is an absolute path, whereas "C:test" is relative the the user's current directory on drive "C".

In order to avoid exposing OS-specific details such as "drives" and "working directory per drive", native host OS paths are converted into a "normalized" form in which:

Normalized paths may be converted back to native OS paths. However, during normalization relative paths may be converted to absolute paths so a denormalized relative path may no longer be relative.

Normalisation of Microsoft Windows paths:

Denormalisation of Microsoft Windows paths:

Import List

    IO
 
Procedure Summary
Denormalize(STRING): STRING

          Convert path from normal to host OS form.
Normalize(STRING): STRING

          Convert path from host OS to normal form.

Procedure Detail

Denormalize

PROCEDURE Denormalize(path: STRING): STRING

Convert path from normal to host OS form.


Normalize

PROCEDURE Normalize(path: STRING): STRING
  RAISES Error;

Convert path from host OS to normal form.