removed UPCASE
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@652
This commit is contained in:
parent
4b9c02ea28
commit
6c2c23fd13
3 changed files with 3 additions and 95 deletions
6
README
6
README
|
@ -3,7 +3,7 @@ DOSBox v0.57
|
|||
Usage:
|
||||
======
|
||||
|
||||
With the new internal shell I've changed the command line a bit, so let's just give some
|
||||
With the new internal shell We've changed the command line a bit, so let's just give some
|
||||
examples of what you can do now.
|
||||
|
||||
dosbox
|
||||
|
@ -50,10 +50,6 @@ Utility for generating a configfile with the current settings and for generating
|
|||
The option -writeconf filename is used to write the current config settings.
|
||||
The option -writelang filename is used to write the current language strings.
|
||||
|
||||
UPCASE <Linux Version only>
|
||||
Utility to convert all files subdirectories of a local directory into upcase so DOSBox can use that directory
|
||||
for mounting. This tool can be quite dangerous if used unproperly. You have been warned.
|
||||
|
||||
To get more information about how to use one these programs use the the /? command line switch.
|
||||
|
||||
The Configfile:
|
||||
|
|
|
@ -149,78 +149,6 @@ static void MEM_ProgramStart(Program * * make) {
|
|||
}
|
||||
|
||||
|
||||
#if !defined (WIN32) /* Unix */
|
||||
|
||||
class UPCASE : public Program {
|
||||
public:
|
||||
void Run(void);
|
||||
void upcasedir(const char * directory);
|
||||
};
|
||||
|
||||
void UPCASE::upcasedir(const char * directory) {
|
||||
DIR * sdir;
|
||||
char fullname[512];
|
||||
char newname[512];
|
||||
struct dirent *tempdata;
|
||||
struct stat finfo;
|
||||
|
||||
if(!(sdir=opendir(directory))) {
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_ERROR_DIR"),directory);
|
||||
return;
|
||||
}
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_SCANNING_DIR"),fullname);
|
||||
while (tempdata=readdir(sdir)) {
|
||||
if (strcmp(tempdata->d_name,".")==0) continue;
|
||||
if (strcmp(tempdata->d_name,"..")==0) continue;
|
||||
strcpy(fullname,directory);
|
||||
strcat(fullname,"/");
|
||||
strcat(fullname,tempdata->d_name);
|
||||
strcpy(newname,directory);
|
||||
strcat(newname,"/");
|
||||
upcase(tempdata->d_name);
|
||||
strcat(newname,tempdata->d_name);
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RENAME"),fullname,newname);
|
||||
rename(fullname,newname);
|
||||
stat(fullname,&finfo);
|
||||
if(S_ISDIR(finfo.st_mode)) {
|
||||
upcasedir(fullname);
|
||||
}
|
||||
}
|
||||
closedir(sdir);
|
||||
}
|
||||
|
||||
|
||||
void UPCASE::Run(void) {
|
||||
/* First check if the directory exists */
|
||||
struct stat info;
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_1"));
|
||||
if (!cmd->GetCount()) {
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_USAGE"));
|
||||
return;
|
||||
}
|
||||
cmd->FindCommand(1,temp_line);
|
||||
if (stat(temp_line.c_str(),&info)) {
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_ERROR_1"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
if(!S_ISDIR(info.st_mode)) {
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_ERROR_2"),temp_line.c_str());
|
||||
return;
|
||||
}
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_CHOICE"),temp_line.c_str());
|
||||
Bit8u key;Bit16u n=1;
|
||||
DOS_ReadFile(STDIN,&key,&n);
|
||||
if (toupper(key)=='Y') {
|
||||
upcasedir(temp_line.c_str());
|
||||
} else {
|
||||
WriteOut(MSG_Get("PROGRAM_UPCASE_RUN_NO"));
|
||||
}
|
||||
}
|
||||
|
||||
static void UPCASE_ProgramStart(Program * * make) {
|
||||
*make=new UPCASE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// LOADFIX
|
||||
|
||||
|
@ -303,22 +231,10 @@ void DOS_SetupPrograms(void) {
|
|||
MSG_Add("PROGRAM_LOADFIX_DEALLOCALL","Used memory freed.\n");
|
||||
MSG_Add("PROGRAM_LOADFIX_ERROR","Memory allocation error.\n");
|
||||
|
||||
#if !defined (WIN32) /* Unix */
|
||||
MSG_Add("PROGRAM_UPCASE_ERROR_DIR","Failed to open directory %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_SCANNING_DIR","Scanning directory %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RENAME","Renaming %s to %s\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_1","UPCASE 0.1 Directory case convertor.\n");
|
||||
MSG_Add("PROGRAM_UPCASE_USAGE","Usage UPCASE [local directory]\nThis tool will convert all files and subdirectories in a directory.\nBe VERY sure this directory contains only dos related material.\nOtherwise you might horribly screw up your filesystem.\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_ERROR_1","%s doesn't exist\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_ERROR_2","%s isn't a directory\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_CHOICE","Converting the wrong directories can be very harmfull, please be carefull.\nAre you really really sure you want to convert %s to upcase?Y/N\n");
|
||||
MSG_Add("PROGRAM_UPCASE_RUN_NO","Okay better not do it.\n");
|
||||
#endif
|
||||
|
||||
/*regular setup*/
|
||||
PROGRAMS_MakeFile("MOUNT.COM",MOUNT_ProgramStart);
|
||||
PROGRAMS_MakeFile("MEM.COM",MEM_ProgramStart);
|
||||
PROGRAMS_MakeFile("LOADFIX.COM",LOADFIX_ProgramStart);
|
||||
#if !defined (WIN32) /* Unix */
|
||||
PROGRAMS_MakeFile("UPCASE.COM",UPCASE_ProgramStart);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -208,10 +208,6 @@ void SHELL_Init() {
|
|||
MSG_Add("SHELL_STARTUP","DOSBox Shell v" VERSION "\n"
|
||||
"DOSBox does not run protected mode games!\n"
|
||||
"For supported shell commands type: HELP\n"
|
||||
#if! defined (WIN32)
|
||||
"DOSBox only works with upcase filenames as dos is case-insensitive.\n"
|
||||
"You can use the UPCASE command for this, but please be careful.\n"
|
||||
#endif
|
||||
"For more information read the README file in DOSBox directory.\n"
|
||||
"\nHAVE FUN!\nThe DOSBox Team\n\n"
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue