functions from the path module that know about trailing slashes