Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started