finish part of add_dirent().