Runtime equivalent of collectFiles. This version uses std.file to read files
from the appropriate directory. Note that for collectFiles, the directory to
use is passed on the command line, whereas in this case, we must receive the
directory containing the files from the caller.