I think I have them working fine now. The results almost replicate the same results as dirname/basename on Linux, except for treating the "device:" or "device:/" string as a directory. The last few were testing output with multiple slashes in the path. When I'd worked on it before, I'd only skimmed the surface of the implementation, *_*.
Code:
Results:
path = "/"
basename = "/"
dirname = "/"
path = "¥"
basename = "¥"
dirname = "¥"
path = ":"
basename = "."
dirname = "."
path = "mass0:"
basename = "."
dirname = "mass0:"
path = "mass0:/"
basename = "."
dirname = "mass0:/"
path = "mass0:something"
basename = "something"
dirname = "mass0:"
path = "mass0:/something"
basename = "something"
dirname = "mass0:/"
path = "mass0:something/"
basename = "something"
dirname = "mass0:"
path = "mass0:/something/"
basename = "something"
dirname = "mass0:"
path = "mass0:something/is"
basename = "is"
dirname = "mass0:something"
path = "mass0:/something/is"
basename = "is"
dirname = "mass0:/something"
path = "mass0:/something/is/"
basename = "is"
dirname = "mass0:/something"
path = "mass0:/something/is/there"
basename = "there"
dirname = "mass0:/something/is"
path = "mass0:/something/is/there/"
basename = "there"
dirname = "mass0:/something/is"
path = "mass0:/something/is/there//"
basename = "there"
dirname = "mass0:/something/is"
path = "mass0:/something/is//there//"
basename = "there"
dirname = "mass0:/something/is"
path = "mass0:/something//is//there//"
basename = "there"
dirname = "mass0:/something//is"