Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce risk of collision in temp directory creation #160

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

mhutch
Copy link
Member

@mhutch mhutch commented Oct 2, 2023

.NET's GetTempFileName is somewhat prone to collision, per dotnet/runtime#73793

We only use to to "reserve" a name for a directory, but so import the new CreateTempSubdirectoryCore method from .NET 7 and use that, as it fixes the collision issue and removes the extra file creation/deletion steps.

This also allows us to tag the temp directories with a "t4 prefix.

.NET's GetTempFileName is somewhat prone to collision,
per dotnet/runtime#73793

We only use to to "reserve" a name for a directory, but
so import the new CreateTempSubdirectoryCore method from
.NET 7 and use that, as it fixes the collision issue
and removes the extra file creation/deletion steps.

This also allows us to tag the temp directories with a
"t4 prefix.
@mhutch mhutch merged commit 2dd0b83 into main Oct 2, 2023
5 checks passed
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