Skip to content

Remove posix calls in TemporaryFile.swift #2087

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

Closed
wants to merge 3 commits into from

Conversation

walter-erquinigo
Copy link

This implements a portable version of mkstemps and mkdtemp so that the code also works on Windows. This simplified the code considerably

Walter Erquinigo added 2 commits April 10, 2019 12:31
@walter-erquinigo walter-erquinigo changed the title Remove posix calls in TemporaryFile.swift [WIP] Remove posix calls in TemporaryFile.swift Apr 10, 2019
@walter-erquinigo walter-erquinigo changed the title [WIP] Remove posix calls in TemporaryFile.swift Remove posix calls in TemporaryFile.swift Apr 10, 2019
@gmittert
Copy link
Contributor

This looks good to me, and the removeItem that this uses just got implemented on Windows today (swiftlang/swift-corelibs-foundation#2117).

@aciidb0mb3r

return prefix + "." + randomMiddleString + suffix
}

func mkstemps(dir: AbsolutePath, prefix: String, suffix: String) throws -> AbsolutePath {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a little nervous about this. I think we should at least use mkstemps where it's available.

Copy link
Author

Choose a reason for hiding this comment

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

I think that the logic is quite straightforward.
Why are you nervous about it? We can discuss it

Copy link
Author

Choose a reason for hiding this comment

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

My team changed my mind, i'll implement this in a posix way and additionally a windows specific way

@tomerd
Copy link
Contributor

tomerd commented Aug 31, 2020

@compnerd is this still relevant given your recent work for Windows support?

@compnerd
Copy link
Member

I don't think that this is relevant any longer. @a20012251 if you think that this is still relevant, please rebase and reopen the PR.

@compnerd compnerd closed this Sep 28, 2020
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.

5 participants