https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
r

Reuben Firmin

03/24/2023, 6:20 PM
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

ephemient

03/24/2023, 6:31 PM
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

Reuben Firmin

03/26/2023, 12:17 PM
This is helpful, thank you
5 Views