Question: Python Script Step 1 Create a class named AnalyzeAFile. The Init method must: Verify the file actually exists. Extract key file system metadata from the

Python Script

Step 1

Create a class named AnalyzeAFile.

  • The Init method must:
    • Verify the file actually exists.
    • Extract key file system metadata from the file and store them as instance attribute. (FilePath, FileSize, File Owner, File Modes, Modify, Access and Creation times for the file etc..)
  • Create another Method to:
    • Extract the first 10 bytes of the header and then store them as an instance variable.
  • Create another Method to:
    • Print your file metadata.
    • Print the header of the file in Hex value.

Step 2

  • Demonstrate the use of the AnalyzeAFile class.
  • Prompt the user for the directory path.
  • Extract all filenames located in the given directory path location by utilizing os.listdir().
  • Loop through these filenames and instantiate an object using the AnalyzeAFile class.
  • Finally, use this object to invoke the two methods you have created. (header, metadata)

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