. . "This - I am certain - works because if there is a slash on the end, then it is removed; if there is no slash, this will still work (even if the last part of the path is only one char long) because of the preceding slash." . .