The f_chdrive function changes the current drive.
FRESULT f_chdrive ( const TCHAR* path /* [IN] Logical drive number */ );
The f_chdrive function changes 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.
Available when FF_FS_RPATH >= 1 and FF_VOLUMES >= 2.
f_chdrive("2:"); /* Set current drive to drive 2 */ f_chdrive(""); /* No effect (set current drive to current drive) */