Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Filesystem class has name, Folder has name from filesystem and items, File has name from Filesystem and its size. Thank you in advance. would prefer
Filesystem class has name, Folder has name from filesystem and items, File has name from Filesystem and its size.
Thank you in advance. would prefer in python if possible
There is Filesystem Class that is the parent of Folder and File Write a function called load filesystem), which has a single parameter called is output. The argument passed to ls output is the name of a file which contains the output of the system command ls -IR. The function should read this file and use it to construct an internal representation of the part of the file system recorded in the file named by ls output. For each directory, create a Folder object with the same name. Add each directory and document contained in that directory as a Folder or File element of its items list. For each File element make sure to set its name and filesize when adding it to the items list of the Folder that contains it. When done the function should return a reference to the top-level Folder item (the one corresponding to the top-level directory in ls output. There is Filesystem Class that is the parent of Folder and File Write a function called load filesystem), which has a single parameter called is output. The argument passed to ls output is the name of a file which contains the output of the system command ls -IR. The function should read this file and use it to construct an internal representation of the part of the file system recorded in the file named by ls output. For each directory, create a Folder object with the same name. Add each directory and document contained in that directory as a Folder or File element of its items list. For each File element make sure to set its name and filesize when adding it to the items list of the Folder that contains it. When done the function should return a reference to the top-level Folder item (the one corresponding to the top-level directory in ls outputStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started