Hello, does anybody have any examples of using `st...
# kotlin-native
r
Hello, does anybody have any examples of using
stat
or
nftw
? I'm attempting to work from the docs at https://linux.die.net/man/3/nftw, but I'm a little lost.
Copy code
// ...
    val dir = "/tmp"
    nftw(dir, ::printEntry, 50, FTW_PHYS)
}

fun printEntry(path: String, ??? ) {

}
e
you need to use
staticCFunction
for the callback
IMO
fts
is easier to use than
(n)ftw
because it operates under the control of your code, not the other way around
using
nftw
, note the comment about limitations
whereas
fts
takes a bit more code but has more features
r
This is helpful, thank you