Get directory files synchronously, because we need to process all the files at once, instead of trying to avoid overlapping processes.