Skip to content

Build temp paths with boost::filesystem separators on Windows - #1203

Open
creat3dworld wants to merge 1 commit into
Snapmaker:mainfrom
creat3dworld:fix-776-temp-path-separators
Open

creat3dworld wants to merge 1 commit into
Snapmaker:mainfrom
creat3dworld:fix-776-temp-path-separators

Conversation

@creat3dworld

Copy link
Copy Markdown

Closes #776

Root cause

Model::get_backup_path() built the temp path by string concatenation with a hardcoded /: backup_path = parent_path.string() + buf.str() where buf starts with "/snapmaker_orca_model/". On Windows temporary_dir() returns backslashes (C:\Users\...\Temp), so the result is C:\...\Temp/snapmaker_orca_model/... — mixed separators, exactly as reported. That path becomes the temp G-code path handed to the post-process script (run_post_process_scripts, path = src_path + ".pp"), and Windows/Python chokes on it. The same function also used backup_path + "/3D/Objects" / "/Metadata" / "/lock.txt" string concatenation.

Fix

Build backup_path with boost::filesystem::path operators (parent_path / "snapmaker_orca_model" / date_dir / time_dir), which insert the native separator, and use temp_path / "3D" / "Objects" etc. for the subdirectories. The directory layout is unchanged (same snapmaker_orca_model/<date>/<time>#<pid>#<id> structure).

Based on the v2.4.1 tag. Upstream main has moved 25 commits ahead of v2.4.1; this branch is based on v2.4.1, and the files it touches were not changed on main since v2.4.1, so it should merge cleanly.

Verification: the patch was verified to apply cleanly to a fresh v2.4.1 copy (dry-run + byte-compare). It was NOT compile-tested — this VM has no build toolchain for OrcaSlicer. Real verification: slice + run a post-process script on Windows and confirm the temp path is all-backslash and the script succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed temp file paths in Windows cause post-process scripts to fail

1 participant