make sure do_dir passes own dir to do_file without creating infinite loops