In this homework, you are asked to emulate the file system structure of HDFS using Firebase and allow the export of its structure in the XML format. The emulated HDFS (or EDFS) should support ls, create, mkdir, rmdir, rm, and export commands as detailed below. Your task is to write a Python script edfs.py to support the above commands. Formats: python edfs.py -ls where is a directory name in EDFS. The command should return names of all files or directories under the given director . For example, “edfs.py -ls /user” will list all files or directories under /user. For another example, “edfs.py -ls /” will list all files or directories under the EDFS root directory. Permitted python libraries are - base64, json, requests, sys, uuid, fileinput. Please also ensure that your file can be executed as mentioned in the questions. For example: python edfs.py -ls Further, You should assume that the directory names only contain alphanumeric characters and do not contain “.”. The filenames however, may contain “.” Please remember to hard-code your firebase url in your code. Please do not download the entire firebase data to implement commands, instead you should rely on Firebase’s functions by sending the appropriate requests.
In this homework, you are asked to emulate the file system structure of HDFS using Firebase and allow the export of its structure in the XML format. The emulated HDFS (or EDFS) should support ls, create, mkdir, rmdir, rm, and export commands as detailed below. Your task is to write a Python script edfs.py to support the above commands.
Formats:
python edfs.py -ls
where <dir> is a directory name in EDFS. The command should return names of all files or directories under the given director <dir>
. For example, “edfs.py -ls /user” will list all files or directories under /user. For another example, “edfs.py -ls /” will list all files or directories under the EDFS root directory.
Permitted python libraries are - base64, json, requests, sys, uuid, fileinput. Please also ensure that your file can be executed as mentioned in the questions.
For example: python edfs.py -ls
Further, You should assume that the directory names only contain alphanumeric characters and do not contain “.”. The filenames however, may contain “.” Please remember to hard-code your firebase url in your code. Please do not download the entire firebase data to implement commands, instead you should rely on Firebase’s functions by sending the appropriate requests.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps