diff --git a/README b/README index b8793b92..3fd7d416 100644 --- a/README +++ b/README @@ -778,10 +778,19 @@ LOADFIX -f loadfix -f -RESCAN +RESCAN [Drive:] [-All] Make DOSBox reread the directory structure. Useful if you changed something on a mounted drive outside of DOSBox. (CTRL - F4 does this as well!) + + Drive: + Drive to refresh. + -All + Refresh all drives. + + if both a Drive: and -All are missing, then the current drive will be + refreshed. + MIXER Makes DOSBox display its current volume settings. diff --git a/docs/dosbox.1 b/docs/dosbox.1 index 729ff4b9..407fc23d 100644 --- a/docs/dosbox.1 +++ b/docs/dosbox.1 @@ -205,7 +205,7 @@ which is located on the local filesystem. Not a mounted drive in .RS .TP .B \-securemode -.RB Switches dosbox " to a more secure mode. In this mode the" +.RB "Switches " dosbox " to a more secure mode. In this mode the" .RI "internal commands " MOUNT ", " IMGMOUNT " and " BOOT " won\'t work." It\'s not possible either to create a new configfile or languagefile in this mode. @@ -242,11 +242,21 @@ The amount of memory to eat up (in kb). Example \-32, \-64 or \-128 Frees all memory eaten up by loadfix. .RE .TP -.B RESCAN +.B RESCAN [\-All] [Drive:] .LP .RB "Make " dosbox " reread the directory structure. Useful if you changed .RB "something on a mounted drive outside " dosbox ".(CTRL\-F4 does" this as well!) +.RS +.TP +.B \-All +.R Reread directory structure for all drives. +.TP +.B Drive: +.RB "Reread directory structure for drive " Drive: +.RE +.LP +.RB "If both " \-All " and " Drive: " are missing, then the current drive is used. .TP .B IMGMOUNT .LP diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index e59c908a..856825a5 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -980,11 +980,29 @@ public: void RESCAN::Run(void) { - // Get current drive + bool all = false; + Bit8u drive = DOS_GetDefaultDrive(); - if (Drives[drive]) { - Drives[drive]->EmptyCache(); + + if(cmd->FindCommand(1,temp_line)) { + //-A -All /A /All + if(temp_line.size() >= 2 && (temp_line[0] == '-' ||temp_line[0] =='/')&& (temp_line[1] == 'a' || temp_line[1] =='A') ) all = true; + else if(temp_line.size() == 2 && temp_line[1] == ':') { + lowcase(temp_line); + drive = temp_line[0] - 'a'; + } + } + // Get current drive + if (all) { + for(Bitu i =0; iEmptyCache(); + } WriteOut(MSG_Get("PROGRAM_RESCAN_SUCCESS")); + } else { + if (drive < DOS_DRIVES && Drives[drive]) { + Drives[drive]->EmptyCache(); + WriteOut(MSG_Get("PROGRAM_RESCAN_SUCCESS")); + } } }