I wonder if File.lstat() is more correct here (otherwise we're following a symlink which may not be waht we want to do)

I'll fiddle with this post-merge and try to write a test for it.