BASENAME(3G-SVR4) RISC/os Reference Manual BASENAME(3G-SVR4)
NAME
basename - return the last element of a path name
SYNOPSIS
cc [flag ...] file ... -lgen [library ...]
#include <libgen.h>
char *basename (char *path);
DESCRIPTION
Given a pointer to a null-terminated character string that
contains a path name, basename returns a pointer to the last
element of path. Trailing slashes (/) are deleted.
If path or *path is zero, pointer to a static constant ``.''
is returned.
EXAMPLES
Input string Output pointer
_____________________________
/usr/lib lib
/usr/ usr
/ /
SEE ALSO
dirname(3G).
basename(1) in the User's Reference Manual.
Printed 11/19/92 Page 1