File::nonexistant is a directory

I brought this up before, but it just bit me in the ass again, so I thought I’d warn everybody.

File f(File::nonexistant);
if (f.isDirectory())

This will assert on linux and the mac and not on the pc.

On linux and the mac, the root directory and non existent are the same thing.

Yes, it’s a bit of a tricky one, that.

The reason is that that directory names are stored without the trailing “/”, so File ("/") is stored internally as an empty string, and that’s the same as the non-existent file. I’ll try to think of with a better plan, but ideas are welcome on the subject!

add . support?

. would correctly map to the root directory, but not end with a trailing slash.

Hmm. That’s pretty good thinking…