Catch errors with opendir(); use K&R formatting