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

Added directory open/next for windows #1071

Closed
wants to merge 1 commit into from
Closed

Added directory open/next for windows #1071

wants to merge 1 commit into from

Conversation

BraedonWooding
Copy link
Contributor

@BraedonWooding BraedonWooding commented Jun 7, 2018

I haven't tested it yet on a windows computer, I'll do that later tonight. Was much easier to implement in the end (they even gave a nice C example which made it extremely easy to build). In saying that I will do some more intensive testing later today.

It is slightly awkward to do windows file 'searching' as to open it you need to search the first file then you search for each 'next file' which means that it is finding the next file before returning the current file, which means I have to malloc the name into the buffer, luckily however I don't need the buffer for anything else so that kind of worked out :).

This fixes #709 and is required for #1068

Note: removed the 'if check' under docgen.zig as that is no longer needed :D.

All stuff changed

  • Removed if condition in docgen to re-enable feature on windows
  • As to support windows Dir struct the 'DirData' field is dependent on OS
  • Implemented windows.PathIsDirectoryEmpty
  • Implemented windows.RemovedDirectory
  • Implemented windows.FindFirstFile
  • Implemented windows.FindNextFile
  • Implemented windows.FindClose
  • Implemented windows.WIN32_FIND_DATA struct
  • Implemented windows_util.FileSearchData containing all the data required for future searches (as well as the current file pointer and if you are at the 'end').
  • Implemented windows_util.windowsPathIsDirectoryEmpty
  • Implemented windows_util.windowsRemoveDirectory
  • Implemented windows_util.windowsFindFirstFile
  • Implemented windows_util.windowsFindNextFile
  • Implemented windows_util.windowsFindClose

@BraedonWooding
Copy link
Contributor Author

BraedonWooding commented Jun 7, 2018

I'll squash once the checks pass :) (I'll also remove all the extra file junk)

@BraedonWooding
Copy link
Contributor Author

Re-opening in another PR since when fixing it on windows it stuffed up my git rip :(.

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.

implement the os.Dir interface for windows
1 participant