dirname man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



dirname(3G)							   dirname(3G)

NAME
     dirname - report the parent directory name of a file pathname

SYNOPSIS
     cc [flag ...] file ... -lgen [library ...]
     #include <libgen.h>
     char *dirname (char *path);

DESCRIPTION
     Given a pointer to a null-terminated character string that contains a
     filesystem pathname, dirname returns a pointer to a static constant
     string that is the parent directory of that file.	In doing this, it
     sometimes places a null byte in the pathname after the next to last
     element, so the content of path must be disposable.  Trailing ``/''
     characters in the path are not counted as part of the path.

     If path or *path is zero, a pointer to a static constant ``.'' is
     returned.

     dirname and basename together yield a complete pathname.  dirname (path)
     is the directory where basename (path) is found.

EXAMPLES
     A simple filename and the strings ``.'' and ``..'' all have ``.''	as
     their return value.
     Input string   Output pointer
     _____________________________
     /usr/lib	    /usr
     /usr/	    /
     usr	    .
     /		    /
     .		    .
     ..		    .

     The following code reads a pathname, changes directory to the appropriate
     directory (see chdir(2)), and opens the file.

     char path[100], *pathcopy;
     int fd;
     gets (path);
     pathcopy = strdup (path);
     chdir (dirname (pathcopy) );
     fd = open (basename (path), O_RDONLY);

SEE ALSO
     basename(1), chdir(2), basename(3G)

									Page 1

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net