f_getcwd


Use this function to get the current working directory.

Format

int f_getcwd (
    char *   path,
    int      maxlen )

Arguments

Argument Description Type
path Where to store the current working directory string. char *
maxlen The length of the buffer. int

Return values

Return value Description
F_NOERR Successful execution.
Else See Error Codes.

Example

#define BUFFLEN 256
void myfunc()
{
    char buffer[BUFFLEN];
    unsigned char ret;
    ret = f_getcwd( buffer, BUFFLEN );
    if (!ret)
    {
        printf( "Current directory is %s", buffer );
    }
    else
    {
        printf( "Error %d", ret )
    }
}