From d693e7b0b25946f7788ffcd942e4f350b571c193 Mon Sep 17 00:00:00 2001 From: Zach Radlicz Date: Tue, 19 Aug 2025 21:35:01 -0500 Subject: [PATCH 1/3] modified some file handling for windows --- src/rtgs_lab_tools/sd_dump/core.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/rtgs_lab_tools/sd_dump/core.py b/src/rtgs_lab_tools/sd_dump/core.py index b242e29d..95dfb2d3 100644 --- a/src/rtgs_lab_tools/sd_dump/core.py +++ b/src/rtgs_lab_tools/sd_dump/core.py @@ -233,15 +233,20 @@ def log(message: str): elif line.startswith("FILE_START:"): parts = line.split(":") full_path = parts[1] + if "System Volume Information" in full_path: + log(f"Sanitizing protected path: {full_path}") + full_path = full_path.replace( + "System Volume Information", "_System Volume Information_" + ) + file_size = int(parts[2]) total_chunks = int(parts[3]) file_num = int(parts[4]) # Create directory structure if needed - file_path = Path(full_path) - if file_path.parts[0] == "/": - # Remove leading slash to make it relative - file_path = Path(*file_path.parts[1:]) + # This robustly removes the leading slash on any OS + relative_path_str = full_path.lstrip('/') + file_path = Path(relative_path_str) output_file_path = output_dir / file_path output_file_path.parent.mkdir(parents=True, exist_ok=True) From 8a77a01dc83ab48b02eb6980dd223cfc238e8439 Mon Sep 17 00:00:00 2001 From: Zach Radlicz Date: Wed, 20 Aug 2025 09:12:58 -0500 Subject: [PATCH 2/3] reformatting --- src/rtgs_lab_tools/sd_dump/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtgs_lab_tools/sd_dump/core.py b/src/rtgs_lab_tools/sd_dump/core.py index 95dfb2d3..6ddd87ba 100644 --- a/src/rtgs_lab_tools/sd_dump/core.py +++ b/src/rtgs_lab_tools/sd_dump/core.py @@ -238,14 +238,14 @@ def log(message: str): full_path = full_path.replace( "System Volume Information", "_System Volume Information_" ) - + file_size = int(parts[2]) total_chunks = int(parts[3]) file_num = int(parts[4]) # Create directory structure if needed # This robustly removes the leading slash on any OS - relative_path_str = full_path.lstrip('/') + relative_path_str = full_path.lstrip("/") file_path = Path(relative_path_str) output_file_path = output_dir / file_path From 6fc496669936fee0e277a8a2f7150015b1b8dc35 Mon Sep 17 00:00:00 2001 From: Zach Radlicz Date: Wed, 20 Aug 2025 09:14:25 -0500 Subject: [PATCH 3/3] incremented version to 0.3.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 007c4d57..0ba17b84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "rtgs-lab-tools" -version = "0.2.0" +version = "0.3.0" description = "Environmental sensing data tools, gridded climate data access, and IoT device management for RTGS Lab" authors = [ {name = "RTGS Lab", email = "rtgs@umn.edu"},