Question: 1. Develop an application that uses file and directory access to encode their structure in a JSON file given a root directory. Create a python
1. Develop an application that uses file and directory access to encode their structure in a JSON file given a root directory. Create a python application that given a command-line argument of a root directory, it will traverse that directory and all subdirectories, saving into a file called struct.dat the JSON representation of the hierarchy of files and directory discovered. Use the following information to name file and directory in the JSON representation of the file/dir hierarchy,
File, Dir, SubDir
This file should be stored in the location that the program is executed and should override the file if it already exist.
2. The program you created writes a JSON file. Is this a text or binary file? Discuss and justify why you would do it as a text file or a binary file. Justify, if done in binary, how would that work and what are the implications of saving the file and dir hierarchy as a binary file in saving and accessing it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
