Open topic with navigation
The following example uses getdrive to save the current place in the file system, before moving to all other available drives. It finally returns to the original drive.
int ch, drive, curdrive; static char path;
// Save current drive letter so it can be restored later
curdrive = getdrive();
// If we can switch to the drive, it exists
lr_output_message ("Available drives are:"); for (drive = 1; drive <= 26; drive++) if (!chdrive(drive)) lr_output_message ("%c: ", drive + 'A' - 1); chdrive(curdrive); // Restore original drive
Action.c(10): Available drives are: