OSPath

Module for OS path operations.

Const

SEP* = Config.SEP;

Procedures

Join

PROCEDURE Join*(VAR dst : String.STRING; left-, right- : ARRAY OF CHAR);

Absolute

Create absolute version of path

PROCEDURE Absolute*(VAR dst : String.STRING; path- : ARRAY OF CHAR);

FileName

Extract filename part of path

PROCEDURE FileName*(VAR dst : String.STRING; path- : ARRAY OF CHAR);

DirName

Extract directory part of path

PROCEDURE DirName*(VAR dst : String.STRING; path- : ARRAY OF CHAR);

Extension

Extract filename extension.

PROCEDURE Extension*(VAR dst : String.STRING; path- : ARRAY OF CHAR);

Match

Match str against pattern similar to the unix shell.

  • “*” - match any string including empty string except for path separator

  • “?” - match any single character except for path separator

  • Character classes are defined with brackets “[abc]”

  • Ranges are defined with “-” : “[a-Z]”

  • Range and character classes can be negated with “!” : “[!a-Z]”

PROCEDURE Match*(str-, pattern- : ARRAY OF CHAR) : BOOLEAN;