Get the basename part of a filename
String_Type path_basename (String_Type filename)
The path_basename
function returns the basename associated
with the filename
parameter. The basename is the non-directory
part of the filename, e.g., on unix c
is the basename of
/a/b/c
.
Get the basename part of a filename but without the extension
String_Type path_basename_sans_extname (String_Type path)
The path_basename_sans_extname
function returns the basename
associated with the filename
parameter, omitting the
extension if present. The basename is the non-directory part of
the filename, e.g., on unix c
is the basename of
/a/b/c
.
path_dirname, path_basename, path_extname, path_concat, path_is_absolute
Combine elements of a filename
String_Type path_concat (String_Type dir, String_Type basename)
The path_concat
function combines the arguments dir
and
basename
to produce a filename. For example, on Unix if
dir
is x/y
and basename
is z
, then the
function will return x/y/z
.
Get the directory name part of a filename
String_Type path_dirname (String_Type filename)
The path_dirname
function returns the directory name
associated with a specified filename.
On systems that include a drive specifier as part of the filename, the value returned by this function will also include the drive specifier.
Return the extension part of a filename
String_Type path_extname (String_Type filename)
The path_extname
function returns the extension portion of the
specified filename. If an extension is present, this function will
also include the dot as part of the extension, e.g., if filename
is "file.c"
, then this function will return ".c"
. If no
extension is present, the function returns an empty string ""
.
Under VMS, the file version number is not returned as part of the extension.
path_sans_extname, path_dirname, path_basename, path_concat, path_is_absolute
Get the value of a search-path delimiter
Char_Type path_get_delimiter ()
This function returns the value of the character used to delimit fields of a search-path.
Determine whether or not a filename is absolute
Int_Type path_is_absolute (String_Type filename)
The path_is_absolute
function will return non-zero is
filename
refers to an absolute filename, otherwise it returns zero.
Strip the extension from a filename
String_Type path_sans_extname (String_Type filename)
The path_sans_extname
function removes the file name extension
(including the dot) from the filename and returns the result.
path_basename_sans_extname, path_extname, path_basename, path_dirname, path_concat