get_current_directory


unsigned get_current_directory(unsigned length,
                               character* buffer)

This function obtains the current directory.

Parameters

unsigned length

The size of the buffer pointed to by the next parameter. The value path_length::maximum is usually sufficient to hold the full path name.

character* buffer

A pointer to a buffer to hold the current directory.

Return

unsigned

0 The call failed.
Other The number of bytes transferred or the required buffer size.

Notes

When the specified buffer is sufficiently large, the value returned is the length (in bytes) of the data placed into the buffer (not including the null-terminator). If the value returned exceeds the specified buffer length, it is the size required to hold the complete path name of the current directory.