Skip to content

Implement removeItem on Windows #1976

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 1 commit into from

Conversation

gmittert
Copy link
Contributor

@gmittert gmittert commented Mar 7, 2019

Use FindFirstFileW to "recursively" remove a directory tree in Windows.

It's probably simpler to implement this by creating a NSURLDirectoryEnumerator (#1966) and DeleteFileW/RemoveDirectoryW'ing everything it returns. Would that be the preferred way to do it?

@millenomi
Copy link
Contributor

Either's fine.

@millenomi
Copy link
Contributor

@swift-ci please test

@gmittert
Copy link
Contributor Author

gmittert commented Mar 7, 2019

Updated to use .withCString(encodedAs:_:) since String.utf16 isn't null terminated.

@compnerd
Copy link
Member

I think that the DirectoryEnumerator is nicer since we can have the same codepath for all the targets that way.

@gmittert
Copy link
Contributor Author

I think that the DirectoryEnumerator is nicer since we can have the same codepath for all the targets that way.

See #2002

@millenomi
Copy link
Contributor

I'm closing this in favor of #2002.

@millenomi millenomi closed this Mar 14, 2019
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.

3 participants