I have some existing Java code that uses java.nio.file.Files.walkFileTree
with the FileVisitor
interface, but now I need to port it to plain C. Is there a C equivalent of this interface? If not, what primitives can I use to build one?
I've looked at the Unix ftw
and nftw
functions, but it doesn't appear that they will work because the callback function doesn't have a parameter for supplying user variables (a single void* param would have been nice). My code needs to be thread-safe.