The structure FileName
defines functions on file names
which are missing in the OPAL library.
List of Import References :
See BOOL
See DENOTATION
SIGNATURE FileName
$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)
-- version 1.1 Tue Sep 3 11:29:46 1996
baseName(Name)
returns the part of a file name following
the last slash. baseName(Name, Suffix)
additionally removes
any suffix matching Suffix
.
dirName(Name)
returns the part of a file name up to and including
the last slash, or an empty denotation if their is no slash. The result of
dirName
is a `normalized' path, in that it can be used as prefix
for other file names. dirName1
returns a dirName
where a trailing slash is removed.
normPath(Name)
normalizes a file name such that it
can be used as a prefix for concatenation: if Name
isn't empty and
doesn't end with a slash, a slash will be appended.
defaultPath(Path, File)
preprends Path
to File
if last one isn't absolute (doesn't start with a slash).
splitSuffix(Name, Delim)
splits a file name into a prefix
preceeding the last occurence of Delim
and a suffix following
(not including) this occurence. A typical use is as in
splitSuffix(Name, ".")
to split-up the last dotted suffix.
Delim
must be a denotation of length one. If Delim
doesn't occure in Name
, then the returned prefix will
be the input name, and the suffix will be empty.
FUN baseName : denotation -> denotation FUN baseName : denotation ** denotation -> denotation FUN dirName : denotation -> denotation FUN dirName1 : denotation -> denotation FUN normPath : denotation -> denotation FUN defaultPath : denotation ** denotation -> denotation FUN splitSuffix : denotation ** denotation -> denotation ** denotation
next node: ProcessArgs,
prev node: Subsystem Unix,
up to node: Subsystem Unix