Created
February 4, 2018 04:08
-
-
Save kesslern/743d5a3c07b8cfbd52e78ec5268a1dc8 to your computer and use it in GitHub Desktop.
Read a directory's filenames in kotlin native
This file contains 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
val dir = opendir("./") | |
if (dir != null) { | |
try { | |
var ep = readdir(dir) | |
while (ep != null) { | |
println(ep.pointed.d_name.toKString()) | |
ep = readdir(dir) | |
} | |
} finally { | |
closedir(dir) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment