
22 Nov
2006
22 Nov
'06
6:23 p.m.
Hi
What, then, is the result of (addExtension "/" "x")? What, in general, is the behavior in case the first argument ends with a path separator?
Properties added: addExtension "/" "x" == "/.x" takeBaseName (addExtension (asDirectory x) "ext") == ".ext"
| What is (takeBaseName "dir.ext/")? "dir"? Or ""? A general principle that | would clarify this could be "An extension of a file path is always a suffix | of the file path. It never contains a path (directory) separator."
takeBaseName "" == "" takeBaseName "test" == "test" takeBaseName (asDirectory x) == "" Hopefully this makes things a bit clearer. Thanks for the comments Neil