From c3116a5edb8fc015802b88571eaba71797b480d6 Mon Sep 17 00:00:00 2001 From: Sanket Bhat Date: Fri, 15 May 2020 20:30:38 +0530 Subject: [PATCH] Misc --- README.md | 3 ++- main.cpp | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f7b7dd6..0b31bea 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ to do the following:
>> touch -> Create File
>> cd -> change directory
>> rmdir -> remove directory
->> rm -> remove file +>> rm -> remove file
+>> ls -> List all subdirectories and files under working directory #### Output ![Ausgabe](https://user-images.githubusercontent.com/23555312/81896358-18cd4d00-95d2-11ea-9526-bfdde30dd6da.PNG) diff --git a/main.cpp b/main.cpp index fee76fb..cb91b8a 100644 --- a/main.cpp +++ b/main.cpp @@ -72,7 +72,7 @@ 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; @@ -80,7 +80,7 @@ class Directory { } } if (dir->child_file) { - cout << "Files" << endl; + cout << "Files:" << endl; File *file = (dir->child_file); while (file) { string file_name = file->name; @@ -315,8 +315,6 @@ int identifyCommand(string ch) { int main() { - - //Creating root directory with parent as null string command; while (true) {