In your comment, you said that you want to start up a process for every subfolder you run into. OTP created the simple_one_for_one
supervisor for that.
In the start_link of the worker process, you can supply the directory path you want the process to index as the argument.
You can look at my full text search engine tutorial for a working example of a simple_one_for_one
supervisor.