Normalizes the given path using the following: 1. removes duplicate slashes/backslashes 2. removes '/./' strings 3. replaces 'path/..' strings with 'path' 4. replaces all slashes/backslashes with the dirSeparator 5. removed trailing slashes if not a root directory This function modifies the given string
Returns the parent directory of the given file/directory. If there is no parent directory, it will return an empty string. This function will include the trailing slash only if it is the root directory. Note: This function does not allocate a new string, instead it will return a slice to the given path.
Returns the length of the substring that is the parent directory of the given path. If there is no parent directory, it will return 0. This function will include the trailing slash only if it is the root directory.