Skip to content

Fix directory creation on Windows#163

Open
austinkimchi wants to merge 1 commit into
scalesim-project:mainfrom
austinkimchi:fix-directory-on-windows
Open

Fix directory creation on Windows#163
austinkimchi wants to merge 1 commit into
scalesim-project:mainfrom
austinkimchi:fix-directory-on-windows

Conversation

@austinkimchi

Copy link
Copy Markdown

Issue

single_layer_sim.py creates layer directories using a shell mkdir command built from the output path.

On Windows, this can fail when the path contains spaces, such as My Path, resulting in the message The syntax of the command is incorrect.

Fixes

This replaces the shell-based mkdir call with os.makedirs(..., exist_ok=True).

This also removes the separate os.path.isdir check because os.makedirs(..., exist_ok=True) already handles both cases:

  • creates the directory if it does not exist
  • does nothing if the directory already exists

Resources

image

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-platform trace output by replacing a shell-based mkdir invocation in single_layer_sim.py with Python’s built-in directory creation (os.makedirs(..., exist_ok=True)), fixing failures on Windows when output paths contain spaces.

Changes:

  • Replace os.system('mkdir ...') with os.makedirs(..., exist_ok=True) for layer trace directory creation.
  • Remove the redundant os.path.isdir pre-check since exist_ok=True handles the “already exists” case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants