PathKit: port to Windows#86
Closed
compnerd wants to merge 1 commit intokylef:masterfrom
compnerd:windows
Closed
Conversation
Windows does not provide the Unix `glob` and `fnmatch` functions. Emulate these with the closes equivalences (`FindFirstFileW` and `PathMatchSpecExW`). This should allow us to use this library on Windows.
djbe
requested changes
Aug 28, 2023
Collaborator
There was a problem hiding this comment.
In stencilproject/Stencil#343 you use withUnsafeFileSystemRepresentation to normalise the path (expand ~, etc…). I'm assuming that change will also be needed here? To replace the NSString dependency?
| if (hSearch == INVALID_HANDLE_VALUE) { | ||
| return [] | ||
| } | ||
| defer { FindClose(hSearch) } |
Collaborator
There was a problem hiding this comment.
Shouldn't this defer be above that first if?
Edit: or is it because you can't close an invalid handle 🤔
Author
There was a problem hiding this comment.
The edit is correct - it would close an invalid handle.
Author
|
Turns out that this is woefully insufficient and the changes required to support this is too invasive. I'm going to close this for now, feel free to use it as a base if you feel motivated to port the library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows does not provide the Unix
globandfnmatchfunctions. Emulate these with the closes equivalences (FindFirstFileWandPathMatchSpecExW). This should allow us to use this library on Windows.This does not cover the tests which will need to be adjusted subsequently.