Whoa, hold on. `fopen` doesn't work with directories *anywhere* (well, maybe it does somewhere, but it's totally not portable). And why would it even be a directory? This function is for files.