The f_getcwd function retrieves the current directory of the current drive.
FRESULT f_getcwd ( TCHAR* buff, /* [OUT] Buffer to return path name */ UINT len /* [IN] 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 full path name of the current directory of the current drive. When FF_VOLUMES is larger than 1, a logical drive number is added to top of the path name.
Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.
Available when FF_FS_RPATH == 2.
TCHAR str[256];
fr = f_getcwd(str, sizeof str / sizeof *str); /* Get current directory path */