Question: So here is my file path D: tst why is this the output and not logging Week - 6 Logging Starter Script - Me

So here is my file path D:\tst why is this the output and not logging Week-6 Logging Starter Script - Me
Investigator Name: (My name)
Class Code and Section: My Class Code
Enter the folder path to scan: D:\CYBV 312\test
Script End ```
(bottom)
# Python Standard Libraries
import os
import re
import logging
import platform
import socket
import uuid
import psutil
import hashlib # Added for SHA256 hashing
import datetime # Added for timestamp
# Function to get system information
def getSystemInfo():
try:
info ={}
info['platform']= platform.system()
info['platform-release']= platform.release()
info['platform-version']= platform.version()
info['architecture']= platform.machine()
info["hostname"]= socket.gethostname()
info['ip-address']= socket.gethostbyname(socket.gethostname())
info['mac-address']=':'.join(re.findall('..','%012x'% uuid.getnode()))
info["processor"]= platform.processor()
info['ram']= str(round(psutil.virtual_memory().total /(1024.0**3)))+" GB"
return info
except Exception as e:
logging.exception(e)
return False
# Function to scan a folder, log metadata, and create SHA256 hashes
def scanFolderAndLog(folder_path):
try:
with open("LoganBrown-ScriptLog.txt","a") as log_file:
for root, dirs, files in os.walk(folder_path):
for file in files:
file_path = os.path.join(root, file)
# Get file metadata
file_info = os.stat(file_path)
timestamp = datetime.datetime.fromtimestamp(file info.st mtime).strftime('%Y-%m-%d %H:%M:%s')
```
\begin{tabular}{|l|l|l|l|l|}
\hline Python Shell & Debug I/O & Exceptions & Messages & OS Commands \\
\hline
\end{tabular}
Debug I/O (stdin, stdout, stderr) appears below
Week-6 Logging Starter Script - Logan Brown
Investigator Name: Logan Brown
Class Code and Section: CYBV 312
Enter the folder path to scan: D:\tst
Script End
So here is my file path D: \ tst why is this the

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