Limit the directories checked when filenames is defined.