File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ to do the following:</strong></br>
14
14
>> touch -> Create File</br >
15
15
>> cd -> change directory</br >
16
16
>> rmdir -> remove directory</br >
17
- >> rm -> remove file
17
+ >> rm -> remove file</br >
18
+ >> ls -> List all subdirectories and files under working directory
18
19
19
20
#### Output
20
21
![ Ausgabe] ( https://user-images.githubusercontent.com/23555312/81896358-18cd4d00-95d2-11ea-9526-bfdde30dd6da.PNG )
Original file line number Diff line number Diff line change @@ -72,15 +72,15 @@ class Directory {
72
72
static void list (Directory *dir) {
73
73
if (dir->child_dir ) {
74
74
Directory *dirHead = dir->child_dir ;
75
- cout << " Sub-directories" << endl;
75
+ cout << " Sub-directories: " << endl;
76
76
while (dirHead) {
77
77
string dir_name = dirHead->name ;
78
78
cout << " \t " << dir_name << endl;
79
79
dirHead = dirHead->next_dir ;
80
80
}
81
81
}
82
82
if (dir->child_file ) {
83
- cout << " Files" << endl;
83
+ cout << " Files: " << endl;
84
84
File *file = (dir->child_file );
85
85
while (file) {
86
86
string file_name = file->name ;
@@ -315,8 +315,6 @@ int identifyCommand(string ch) {
315
315
316
316
317
317
int main () {
318
-
319
- // Creating root directory with parent as null
320
318
string command;
321
319
322
320
while (true ) {
You can’t perform that action at this time.
0 commit comments