Skip to content

CreateDirectoryDeepNoThrow must fail if the path exists and it is not a directory - #671

Open
nikola-sh wants to merge 3 commits into
microsoft:masterfrom
nikola-sh:fix_create_dir_for_file
Open

nikola-sh wants to merge 3 commits into
microsoft:masterfrom
nikola-sh:fix_create_dir_for_file

Conversation

@nikola-sh

@nikola-sh nikola-sh commented Oct 2, 2026 •

Copy link
Copy Markdown

CreateDirectoryDeepNoThrow(L"C:\\foo") call succeeds if C:\foo is a regular file. It can be confusing because a directory is expected to be at C:\foo after the succeeded call.

…ot a directory

`CreateDirectoryDeepNoThrow(L"C:\\foo")` call succeeds if `C:\foo` is a regular file.
It can be confusing because existing directory at `C:\foo` is expected after the succeeded call.
@nikola-sh
nikola-sh force-pushed the fix_create_dir_for_file branch from ab8e17d to 83622e0 Compare October 2, 2026 14:02
@nikola-sh
nikola-sh marked this pull request as ready for review October 2, 2026 14:56
@nikola-sh nikola-sh changed the title CreateDirectoryDeepNoThrow must fail if the path exists and it is not a directory CreateDirectoryDeepNoThrow must fail if the path exists and it is not a directory Oct 15, 2026
Comment thread include/wil/filesystem.h Outdated
Comment thread include/wil/filesystem.h Outdated
Comment thread include/wil/filesystem.h Outdated

@dunhor Duncan Horn (dunhor) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

@dunhor

Copy link
Copy Markdown
Member

Build failure looks related to either an MSVC or Clang update. I'll look into it

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