Split a path in directory and file name. Only in the case that the
supplied path is empty, both parts are empty strings. Otherwise,
"." is filled in for the corresponding part, if necessary.
Unless the path is empty, concatenating the returned path and file
name components with a slash in between, makes a valid path to the
file.
split_path splits off the last path component. This isn't the
same as the text after the last
/.
Note that the last path component might be
"..". Then it is
not possible to deduce the refered directory's name from the path.
Then an IO action for getting the real path is necessary.
Examples:
split_path "/a/b/c" == ("/a/b", "c")
split_path "foo" == (".", "foo")
split_path "foo/bar" == ("foo", "bar")
split_path "foo/.." == ("foo", "..")
split_path "." == (".", ".")
split_path "" == ("", "")
split_path "/foo" == ("/", "foo")
split_path "foo/" == (".", "foo")
split_path "foo/." == (".", "foo")
split_path "foo///./bar" == ("foo", "bar")
See
slice_path.