Skip to content

Reject non-directories in nob_mkdir_if_not_exists - #290

Open
Zaczero wants to merge 1 commit into
tsoding:next-releasefrom
Zaczero:submit/mkdir-collision
Open

Zaczero wants to merge 1 commit into
tsoding:next-releasefrom
Zaczero:submit/mkdir-collision

Conversation

@Zaczero

@Zaczero Zaczero commented Nov 22, 2026

Copy link
Copy Markdown

mkdir returns EEXIST for a regular file too. Check that the existing path is a directory before returning success; on POSIX, a symlink to a directory still works.

EEXIST does not imply that the existing path is a directory. Follow links when checking it, so a link to a build directory still works.
@Zaczero
Zaczero marked this pull request as ready for review November 22, 2026 20:25
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.

1 participant