Chapter Contents

Previous

Next
getwd

getwd



Get Working Directory Path Name

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
RELATED FUNCTIONS


SYNOPSIS

#include <unistd.h>
char *getwd(char *buffer);


DESCRIPTION

getwd determines and stores the name of the working UNIX System Services directory. The buffer argument is an array where the path name is to be stored. It should address an area of at least PATH_MAX+1 bytes.

Note:   The PATH_MAX symbol is defined in the header file.  [cautionend]

When you call getwd in an application which was not compiled with the posix option, the returned directory name will begin with an hfs: style prefix.


RETURN VALUE

If successful, getwd returns a pointer to the buffer in which the directory path name was stored. If it fails, it returns NULL.


USAGE NOTES

The getwd function can only be used with MVS 5.2.2 or a later release.

Note:   Use of the more portable and standard getcwd function is recommended in place of getwd.  [cautionend]


RELATED FUNCTIONS

getcwd


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.