I need to use Squirrel-lang for a college assignment, and I have to count the files in a directory tree using threads. I've got the treading under control, but I can't for the life of me find any useful information on how to navigate directories in this language. So far I've only managed to figure out that I can open a directory as a file (Which makes sense in an UNIX system) using
local currDirr = file(".", "r");
But the Squirrel documentation is incredibly vague regarding its filesystem API and any similar questions I could find on the matter are 10+yrs old, when Squirrel didn't even have an IO library yet. Does anyone know how I could traverse the filesystem here? Or at least point me in a direction to embed some C/C++ code that lets me do this through Squirrel's C API.
Thanks in advance
PD: Just in case anyone wonders why I have to use Squirrel specifically, the assignment is to solve 2 threading-related problems with a language whose name has the same number of letters as yours. Squirrel was the closest thing I could find to a general purpose language with 8 letters that had more than 5 sentences written about it online. If anyone knows of another language that would be better suited for this, said suggestions are also welcome.
I hope this is not too late. You can check the minimal implementation of the language in the official repository. On top of it, you can register your own functions in the root table. The docs provide an example:
So you can register a function like the ones suggested in this question.