Not all stdio implementations disallow one to open a directory with fopen(3) and so we specifically check for directories as it is also in the standard search path.