\db_path style
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import os
|
||||
|
||||
|
||||
def ExtractVolumeLetter(path: str) -> str:
|
||||
"""从绝对路径中提取盘符"""
|
||||
drive = os.path.splitdrive(path)[0]
|
||||
if not drive:
|
||||
raise ValueError(f"无法从路径中提取盘符:{path}")
|
||||
return drive[0].upper() # 返回 'Y'
|
||||
def GetVolumeLetter() -> str:
|
||||
from ntfs_utils.main import volume_letter
|
||||
return volume_letter
|
||||
|
||||
|
||||
def CopySingleFragmentFiles(source_data_dict, target_path):
|
||||
@@ -29,7 +26,7 @@ def CopySingleFragmentFiles(source_data_dict, target_path):
|
||||
print("错误:缺少必要的文件信息")
|
||||
return
|
||||
|
||||
source_disk_path = ExtractVolumeLetter(absolute_path)
|
||||
source_disk_path = GetVolumeLetter()
|
||||
target_file_path = os.path.join(target_path, file_name)
|
||||
|
||||
try:
|
||||
@@ -105,7 +102,7 @@ def CopyMultiFragmentFiles(
|
||||
start_byte = item['start_byte']
|
||||
length_byte = item['length']
|
||||
|
||||
volume_letter = ExtractVolumeLetter(item['absolute_path'])
|
||||
volume_letter = GetVolumeLetter()
|
||||
|
||||
# 读取分片内容
|
||||
fragment_content = ReadDiskBytes(volume_letter, start_byte, length_byte)
|
||||
|
Reference in New Issue
Block a user