Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
StrScr committed Jun 16, 2017
1 parent 4b4cba2 commit e181a6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Binary file removed fat
Binary file not shown.
Binary file removed shell
Binary file not shown.
12 changes: 7 additions & 5 deletions shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct DirEntry{
unsigned int filesize;
char reserved[6];
};
usint getNextAvailableDATAIndex();

usint getNextAvailableIndex();
usint getFATindex(int);
void setFATindex(int, usint);
Expand Down Expand Up @@ -98,7 +98,7 @@ int main(int argc, char* argv[]){
string line;
getline(cin,line);
vector<string> tokens = getTokens(line, ' ');
if(tokens.size() == 0 || tokens[0] == "exit"){
if(tokens[0] == "exit"){
status = 1;
}else if(tokens[0]=="ls"){
DirEntry* myDir = parseDirEntries(getDataCluster(currentIndex));
Expand Down Expand Up @@ -203,7 +203,7 @@ int main(int argc, char* argv[]){
}
cout << "Changed current directory to '" << tokens[1] << "'." << endl;
}else{
cout << "'" << tokens[1] << "' is not a directory!" << endl;
cout << "cd: '" << tokens[1] << "' is not a directory!" << endl;
}
break;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ int main(int argc, char* argv[]){
cout << "a hyphen '-' would unset it, or a period '.' would not change it. (E.g.: -.HR)" << endl;
cout << "[V]olume Label, [S]ystem File, [H]idden, [R]ead-Only." << endl << endl;
}
}else if (tokens[0]=="rmdir") {
}else if(tokens[0]=="rmdir") {
if(tokens.size()>1){
if(tokens[1].length()>11 || tokens[1].length()<1){
cout << "rmdir: Wrong length for specified name! Must be 1 to 11 characters long." << endl;
Expand Down Expand Up @@ -366,8 +366,10 @@ int main(int argc, char* argv[]){
}else{
cout << "rm: Need to specify filename!" << endl;
}
}else if (tokens[0]=="pwd") {
}else if(tokens[0]=="pwd") {
cout << currentDir <<endl;
}else{
cout << "Unknown command '" << tokens[0] << "'!" << endl;
}
//status = executeCommand(tokens);
};
Expand Down

0 comments on commit e181a6c

Please sign in to comment.