Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

basename(1)

dirname(3G)

basename(3G)

NAME

basename − return the last element of a path name

SYNOPSIS

cc [ flag ... ] file ... −lgen [ library ... ]

#include <libgen.h>

char ∗basename(char ∗path);

MT-LEVEL

MT-Safe

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 “/” characters are deleted. 

If path or ∗path is zero, pointer to a static constant “.” is returned. 

EXAMPLES

Input stringOutput pointer
/usr/liblib
/usr/usr
//

SEE ALSO

basename(1), dirname(3G)

NOTES

When compiling multi-thread applications, the _REENTRANT flag must be defined on the compile line.  This flag should only be used in multi-thread applications. 

SunOS 5.5/SPARC  —  Last change: 22 Jan 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026