Skip to content

Commit b5348b9

Browse files
committed
Fix asyncio handling in earlier versions of python
1 parent f47bb91 commit b5348b9

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

analyzeMFT.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@
55
import asyncio
66

77
def setup_path():
8-
src_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))
9-
if src_path not in sys.path:
10-
sys.path.insert(0, src_path)
8+
# Try multiple paths to find src/analyzeMFT
9+
script_dir = os.path.dirname(os.path.abspath(__file__))
10+
possible_paths = [
11+
os.path.join(script_dir, 'src'), # src/ in same directory as script
12+
os.path.join(script_dir, '..', 'src'), # src/ in parent directory
13+
script_dir, # current directory
14+
]
15+
16+
for path in possible_paths:
17+
src_path = os.path.abspath(path)
18+
analyzeMFT_path = os.path.join(src_path, 'analyzeMFT')
19+
if os.path.exists(analyzeMFT_path) and os.path.isdir(analyzeMFT_path):
20+
if src_path not in sys.path:
21+
sys.path.insert(0, src_path)
22+
return
23+
24+
# Fallback: add both current directory and src to path
25+
current_dir = os.getcwd()
26+
src_path = os.path.join(current_dir, 'src')
27+
for path in [src_path, current_dir]:
28+
if path not in sys.path:
29+
sys.path.insert(0, path)
1130

1231
def main():
1332
setup_path()

test_output.csv

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Record Number,Record Status,Record Type,File Type,Sequence Number,Parent Record Number,Parent Record Sequence Number,Filename,Filepath,SI Creation Time,SI Modification Time,SI Access Time,SI Entry Time,FN Creation Time,FN Modification Time,FN Access Time,FN Entry Time,Object ID,Birth Volume ID,Birth Object ID,Birth Domain ID,Has Standard Information,Has Attribute List,Has File Name,Has Volume Name,Has Volume Information,Has Data,Has Index Root,Has Index Allocation,Has Bitmap,Has Reparse Point,Has EA Information,Has EA,Has Logged Utility Stream,Attribute List Details,Security Descriptor,Volume Name,Volume Information,Data Attribute,Index Root,Index Allocation,Bitmap,Reparse Point,EA Information,EA,Logged Utility Stream,MD5,SHA256,SHA512,CRC32
2+
0,Invalid,Not in Use,File,0,0,0,,,Not defined,Not defined,Not defined,Not defined,Not defined,Not defined,Not defined,Not defined,,,,,False,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
3+
1,Valid,In Use,File,57,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
4+
2,Valid,In Use,File,4,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
5+
3,Valid,In Use,File,44,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
6+
4,Valid,In Use,File,92,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
7+
5,Valid,In Use,Directory,24,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
8+
6,Valid,In Use,File,1,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
9+
7,Valid,In Use,File,87,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
10+
8,Valid,In Use,File,56,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
11+
9,Valid,In Use,File,46,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
12+
10,Valid,In Use,File,30,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,
13+
11,Valid,In Use,File,51,0,0,,,Invalid timestamp,Invalid timestamp,Not defined,Invalid timestamp,Not defined,Not defined,Not defined,Not defined,,,,,True,False,False,False,False,False,False,False,False,False,False,False,False,[],None,,None,None,None,None,None,None,None,None,None,,,,

test_sample.mft

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)