Skip to content

Commit bd236d6

Browse files
authored
Add files via upload
1 parent 6745121 commit bd236d6

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

lnkfile.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def get_field_value(lnk_info, field):
9494
return value
9595

9696
def write_to_csv(lnk_filepath, volume_type, volume_serial_number, user_path, creation_time, modification_time, access_time):
97-
csv_filename = 'lnk_info.csv'
98-
97+
csv_filename = os.path.join(os.getcwd(),'lnk_info.csv')
98+
9999
# Scrivi le informazioni nel file CSV
100100
with open(csv_filename, 'a', newline='', encoding='utf-8') as csvfile:
101101
csv_writer = csv.writer(csvfile)
@@ -117,11 +117,10 @@ def read_recent_folder():
117117
lnk_filepath = os.path.join(root, file)
118118
parse_lnk_file(lnk_filepath)
119119

120-
if __name__ == "__main__":
121-
csv_filename = 'lnk_info.csv'
122-
with open(csv_filename, 'w', newline='', encoding='utf-8') as csvfile:
123-
csv_writer = csv.writer(csvfile)
124-
read_recent_folder()
120+
csv_filename = os.path.join(os.getcwd(),'lnk_info.csv')
121+
with open(csv_filename, 'w', newline='', encoding='utf-8') as csvfile:
122+
csv_writer = csv.writer(csvfile)
123+
read_recent_folder()
125124

126125

127126

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import pandas as pd
1212
import time
1313
import subprocess
14+
import lnkfile
15+
import nb_usb
1416

1517
class USBQueryApp:
1618
def __init__(self, root):

nb_usb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def convert_filetime(match_timestamp):
3232
csv_writer = csv.writer(csvfile)
3333

3434
# Ottieni il percorso del file Python
35-
python_file_path = os.path.dirname(os.path.abspath(__file__))
35+
python_file_path = os.path.join(os.getcwd(),'')
3636
timestamp_file = time.strftime("%Y%m%d%H%M%S")
3737
usbstor_txt_path = os.path.join(python_file_path, f'usbstor_{timestamp_file}.txt')
3838

0 commit comments

Comments
 (0)