Split a path in components. Repeated "
/" characters don't
lead to empty components. "
." path components are removed. If
the path is absolute, the first component will start with
"
/". "
.." components are left intact. They can't be
simply removed, because the preceding component might be a symlink. In
this case,
realpath is probably what you need.
The case that the path is empty, is probably an error. However, it is
treated like "
.", yielding an empty path components list.
Examples:
slice_path "/" = ["/"]
slice_path "/foo/bar" = ["/foo","bar"]
slice_path "..//./" = [".."]
slice_path "." = []
See
unslice_path,
realpath,
realpath_s.