[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


getcwd

Get the current directory.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <unistd.h>
char *getcwd(char *buf, int size);
Parameters:

Parameters for this facility are:

buf  
char  
A buffer to hold the pathname of the current working directory  
size  
int  
The size of the buffer  

Remarks:

The function getcwd() takes two arguments. One is a buffer large enough to store the full directory pathname, the other argument is the size of that buffer.

Return:

If successful, getcwd() returns a pointer to the buffer. If unsuccessful, getcwd() returns NULL and sets errno.

See Also:

"Overview of errno.h"

For example of getcwd usage:
Refer to "Example of chdir() usage.".


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000