Question: Python script language needed to build directories and files. My plan is to manage a file sytem with multiple directories. I need to be able

Python script language needed to build directories and files.
My plan is to manage a file sytem with multiple directories. I need to be able to search for a file without taking a lot of time.
First, use a File class and instance method for naming the file or directory.
Next, please allow for three methods to access these three properties.
Then, provide a tester class so we can search for the file efficiently.
Also, use three arguments to perform a search; for example search the directory, the filename, along with the current file path and use a separating forward slash and the name of the directory to update the path.
Finally, confirm each step through each file in the files of this directory.
1. If the name of a file matches the name of the file to search for, return the path with another separating forward slash and the name of the file.
2. If the last part of the path (after the last forward slash) matches the name of the file, return the path (this part is just to indicate you have already found the file).
3. If the file is a directory, recursively call this search function with that file, the name of the file to search for, and the path. Assign this call to the path.
Return the string "File not found." after the loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!