SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST |
Object Object
Procedure Summary | |
BaseName(STRING): STRING Calculates the basename of pathname path. | |
Decode(ARRAY OF CHAR): STRING Convert a system-specific sequence of bytes path representing a file path into a string instance. | |
DirName(STRING): STRING Calculates the directory name of pathname path. | |
Encode(STRING): CharsLatin1 Encode the file path or command path as a system-specific sequence of bytes. | |
QuoteForShell(STRING): STRING Convert a path to a form suitable for passing as a command-line argument to a system command. | |
SplitExt(STRING, VAR STRING, VAR STRING) Splits the pathname path into a pair `(root, ext)' such that `concat(root,ext) = path'. |
Procedure Detail |
PROCEDURE BaseName(path: STRING): STRING
Calculates the basename of pathname path. The basename is the last pathname component of path. It never contains a slash. If path ends with a slash, then the basename is the empty string. If path does not contain a slash, then the basename equals path.
PROCEDURE Decode(path: ARRAY OF CHAR): STRING
Convert a system-specific sequence of bytes path representing a file path into a string instance. This is the inverse of Encode.
PROCEDURE DirName(path: STRING): STRING
Calculates the directory name of pathname path.
PROCEDURE Encode(path: STRING): CharsLatin1
Encode the file path or command path as a system-specific sequence of bytes.
The default implementation returns a string with all character codes above `0FFX' replaced with the character `_'. That is, non ISO Latin1 characters are discarded. For instances of Object.String8, it is the identity operation.
PROCEDURE QuoteForShell(path: STRING): STRING
Convert a path to a form suitable for passing as a command-line argument to a system command. Certain characters cannot be directly used in command-line path arguments because the characters have special significance to the system shell. For example, spaces are used to separate arguments in command lines, so a path containing spaces must be quoted to cause the shell to treat it as a literal.
This function determines if path needs to be quoted. If so, it returns a quoted version. Otherwise, the original path is returned.
PROCEDURE SplitExt(path: STRING; VAR root: STRING; VAR ext: STRING)
Splits the pathname path into a pair `(root, ext)' such that `concat(root,ext) = path'. The extension ext is empty or begins with a period and contains at most one period. The extension string does not contain a slash character.