Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketbhat7 committed May 15, 2020
1 parent b5d1930 commit c3116a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ to do the following:</strong></br>
>> touch -> Create File</br>
>> cd -> change directory</br>
>> rmdir -> remove directory</br>
>> rm -> remove file
>> rm -> remove file</br>
>> ls -> List all subdirectories and files under working directory
#### Output
![Ausgabe](https://user-images.githubusercontent.com/23555312/81896358-18cd4d00-95d2-11ea-9526-bfdde30dd6da.PNG)
6 changes: 2 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ class Directory {
static void list(Directory *dir) {
if (dir->child_dir) {
Directory *dirHead = dir->child_dir;
cout << "Sub-directories" << endl;
cout << "Sub-directories:" << endl;
while (dirHead) {
string dir_name = dirHead->name;
cout << "\t" << dir_name << endl;
dirHead = dirHead->next_dir;
}
}
if (dir->child_file) {
cout << "Files" << endl;
cout << "Files:" << endl;
File *file = (dir->child_file);
while (file) {
string file_name = file->name;
Expand Down Expand Up @@ -315,8 +315,6 @@ int identifyCommand(string ch) {


int main() {

//Creating root directory with parent as null
string command;

while (true) {
Expand Down

0 comments on commit c3116a5

Please sign in to comment.