The f_getcwd function retrieves the current directory.
FRESULT f_getcwd ( TCHAR* Buffer, /* Pointer to the buffer */ UINT BufferLen /* The length of the buffer */ );
FR_OK, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_TIMEOUT, FR_NOT_ENOUGH_CORE
The f_getcwd function retrieves the current directory of the current drive in full path string including drive number.
Available when _FS_RPATH == 2.