Last active
August 29, 2015 14:17
-
-
Save asterite/5710f02a0237e9d1bc64 to your computer and use it in GitHub Desktop.
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
lib LibC | |
fun opendir(name : UInt8*) : Dir* | |
fun find_first_file = FindFirstFile(...) : Dir* | |
end | |
module LibCWrappers | |
def self.opendir(path) | |
ifdef windows | |
LibC.find_first_file(path, ...) | |
else | |
LibC.opendir(path) | |
end | |
end | |
end | |
class Dir | |
def initialize(@path) | |
@dir = LibCWrappers.opendir(@path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment