Only one tiny concern here: if `path` is a file instead of a dir, a prefix check isn't fully safe and we should just do a strict equality check (and actually you could skip the forEach() in that case too).

I think we have this same bug in a couple of places in FileSystem though, so I'm not sure if we should maybe just wait and fix them all together.  Thoughts?