*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> dirname (3)              
Title
Content
Arch
Section
 

DIRNAME(3)

Contents


NAME    [Toc]    [Back]

     dirname - report the parent directory name of a file pathname

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <libgen.h>

     char *
     dirname(char *path);

DESCRIPTION    [Toc]    [Back]

     The dirname() function takes a pointer to a character string that contains
 a pathname, path, and returns a pointer to a string that is a pathname
 of the parent directory of path.  Trailing '/' characters in path
     are not counted as part of the path.

     If path does not contain a '/', then dirname() returns a pointer to the
     string ".".

     If path is a null pointer or points to an empty string, dirname() returns
     a pointer to the string ".".

RETURN VALUES    [Toc]    [Back]

     The dirname() function returns a pointer to a string that is the parent
     directory of path.

SEE ALSO    [Toc]    [Back]

      
      
     basename(3)

STANDARDS    [Toc]    [Back]

     +o   X/Open Portability Guide Issue 4.2 (``XPG4.2'')
     +o

BUGS    [Toc]    [Back]

     If the length of the result is longer than PATH_MAX bytes (including the
     terminating nul), the result will be truncated.

     The dirname() function returns a pointer to static storage that may be
     overwritten by subsequent calls to dirname().  This is not strictly a
     bug; it is explicitly allowed by .

BSD                            October 16, 2002                            BSD
[ Back ]
 Similar pages
Name OS Title
acl_get_file Tru64 Given the pathname to a file or directory, retrieve the designated ACL
create_child HP-UX Creates a child pointer at the master replica of the parent directory
getcwd FreeBSD get working directory pathname
getwd Tru64 Get current directory pathname
getcwd NetBSD get working directory pathname
getcwd Tru64 Get the pathname of the current directory
getwd NetBSD get working directory pathname
getwd OpenBSD get working directory pathname
getwd FreeBSD get working directory pathname
pxfgetcwd IRIX Gets the pathname of the working directory
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service