## f_getcwd

The f_getcwd function retrieves the current directory.

    FRESULT f_getcwd (
      TCHAR* Buffer,  /* Pointer to the buffer */
      UINT BufferLen  /* The length of the buffer */
    );

#### Parameters

Buffer
  Pointer to the buffer to receive the current directory string.
BufferLen
  Size of the buffer in unit of TCHAR.

#### Return Values

FR_OK (0)
  The function succeeded.
FR_NOT_READY
  The disk drive cannot work due to no medium in the drive or any other reason.
FR_DISK_ERR
  The function failed due to an error in the disk function.
FR_INT_ERR
  The function failed due to a wrong FAT structure or an internal error.
FR_NOT_ENABLED
  The logical drive has no work area.
FR_NO_FILESYSTEM
  There is no valid FAT volume on the drive.
FR_NOT_ENOUGH_CORE
  Insufficient size of Buffer.

#### Description

The f_getcwd function retrieves the current directory of the current drive in full path string including drive number.

#### QuickInfo

Available when `_FS_RPATH == 2`.

#### See Also

`f_chdrive, f_chdir`

Return