Question: Need to create python3 program which will do the following: 1) open the file called createfile.txt but read only and no modifications to original file.

Need to create python3 program which will do the following:

1) open the file called createfile.txt but read only and no modifications to original file. Please see the tree below to see files that may be produced. random files are generated and each time the file is opened, it generates different number of directories and files.

2) Enumerate the entire folder making it easier to see the folder structure of the file content.

3) use the home directory to generate (sha512) hash of all files in the folder and subfolders.

4) create a new folder for each type of file extension found

i) this new (parent) folder MUST NOT modify the original folder

ii) copy the files to the NEW folders based on the file extension and rename them so hashes are used instead of file names.

i.e. myfile.tx will be copied to the TX file as abc123.tx and myfile.zip would be copied to the zip folder as xyz987.zip

CANNOT save the copy in the same folder as original files; the original files/folders must not be modified!!!

Please refer to the file directory "tree" below showing a possible directory (including file types) once the createfiles.tx file is run:

juniper@ubuntu:~/Documents/misc$ tree . createfiles.tx folder068 sub008 file006a4.mal file00705.txt file029ef.zip file03449.mpp sub095 file00e41.txt file02855.txt file03109.mal file03cfd.txt sub017 file006f2.zip file00718.zip file03ddc.mpp sub056 file0097f.mal file036d4.evp file03731.mal file04314.mpp file0495f.evp sub061 file006a1.txt file007f7.txt file00844.worm file02602.evp file0433e.txt file04b44.mal sub03d file00329.worm file01082.mal file01908.worm file01faf.evp sub051 file005dc.worm file01233.worm file020fd.evp file0438e.worm sub086 file01575.zip file0198f.txt file01dd3.evp file0227a.txt file0378d.mpp sub08a file0368f.mpp file03aa8.zip file03d86.txt file04588.mpp file04a9a.evp sub022 file00827.mal file00aba.zip file041b4.txt sub04b file00688.mpp file021dc.mpp file03206.mal file04c91.txt sub089 file018db.mpp file01ae0.mpp file035e1.worm file03847.evp file03c7c.mal file04b14.mpp sub0ae file00b70.mpp file01290.mpp file019cb.txt file01e85.mal sub064 file0252b.mal file03c75.txt file042c3.evp file0455a.zip file04cb3.mal sub0b3 file000cc.mpp file00ba3.mal file028eb.evp file0302a.zip sub094 file0048a.evp file00520.mal file027c6.worm file0280b.evp file03607.txt sub017 file00015.worm file005f9.zip file04c43.worm sub0e8 file0034c.worm file01f05.mal file026a0.zip file02ce9.mal file038d4.mal file045a4.worm sub0f0 file00f72.mpp file01b59.mpp file035b0.txt sub0fd file00389.txt file01ecf.txt file03859.mpp file03ce5.mal 21 directories, 88 files

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 Finance Questions!