Likewise, below we should have an isSamePath() so we don't have to have special code to deal with trailing slashes but I realize both of these two are outside the scope of the fix.  Let's keep it in mind for the FILE API rework though.