1
0
Fork 0

Enchance RESCAN with drive paramater and -All flag

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3742
This commit is contained in:
Peter Veenstra 2011-08-16 10:41:59 +00:00
parent 817651144b
commit 9df334048f
3 changed files with 43 additions and 6 deletions

11
README
View file

@ -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.

View file

@ -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

View file

@ -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; i<DOS_DRIVES;i++) {
if (Drives[i]) Drives[i]->EmptyCache();
}
WriteOut(MSG_Get("PROGRAM_RESCAN_SUCCESS"));
} else {
if (drive < DOS_DRIVES && Drives[drive]) {
Drives[drive]->EmptyCache();
WriteOut(MSG_Get("PROGRAM_RESCAN_SUCCESS"));
}
}
}