Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

91 Risk management techniques.

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago