On Sun, 2010-10-10 at 13:24 +0200, Attila Lendvai wrote:
i repeatedly struggle due to this behavior: (iolib.pathnames:file-path-directory (iolib.pathnames:file-path "/tmp/")) => (:ROOT)
What's the problem exactly ?
i list a few cases that doesn't match my expectations when it comes to a high level lib dealing with file path parsing and manipulating:
(file-path-file-name (file-path "/tmp/foo/")) => "foo"
(file-path-file-type (file-path "/tmp/foo.bar/")) =>"bar"
On *nix and Windows, there's no syntactic difference between paths representing files and directories(except for a possible final slash), so this means that the fact that a path represents a directory must be baked into the application logic: if you know that for your purposes "/tmp/foo" must be a directory, then calling file-path-file-name on it is just nonsensical
(file-path-namestring (file-path "/tmp/foo/")) => "/tmp/foo"
this last one especially when interfacing with cl:ensure-directories-exist
Ok, I'll fix this because it would be useful that (string= <path> (file-path-namestring (file-path <path>))) be always T