Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions