[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

getwd Subroutine

Purpose

Gets current directory path name.

Library

Standard C Library (libc.a)

Syntax


#include <unistd.h>

char *getwd ( PathName)
char *PathName;

Description

The getwd subroutine determines the absolute path name of the current directory, then copies that path name into the area pointed to by the PathName parameter.

The maximum path-name length, in characters, is set by the PATH_MAX value, as specified in the limits.h file.

Parameters

PathName Points to the full path name.

Return Values

If the call to the getwd subroutine is successful, a pointer to the absolute path name of the current directory is returned. If an error occurs, the getwd subroutine returns a null value and places an error message in the PathName parameter.

Related Information

The getcwd (getcwd Subroutine) subroutine.

Files, Directories, and File Systems for Programmers in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]