## f_chdrive

The f_chdrive function changes the current drive.

    FRESULT f_chdrive (
      const TCHAR* path  /* [IN] Logical drive number */
    );

#### Parameters

path
  Specifies the logical drive number to be set as the current drive.

#### Return Values

FR_OK, FR_INVALID_DRIVE

#### Description

The `f_chdrive` function changes only the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable, so that it also affects other tasks that using the file functions.

#### QuickInfo

Available when `FF_FS_RPATH >= 1`.

#### Example

        f_chdrive("2:");  /* Set drive 2 as current drive */

        f_chdrive("");    /* No effect (set current drive as current drive) */

        f_chdrive("/flash");  /* Set drive "flash" as current drive (at Unix style volume ID) */

#### See Also

`f_chdir, f_getcwd`

Return