Mon Oct 4 12:33:59 CEST 2004
"Ulf Wiger (AL/EAB)" <ulf.wiger@REDACTED> wrote:
>On my Solaris box, basename and dirname are synonymous.
$ uname -sr
$ basename /foo/bar
$ dirname /foo/bar
Perhaps you mean that theye are synonymous when the argument is "." - if
so, yes, that follows from their definition.
>I'd like to suggest then that filename:dirname(".") stays as is,
>but that filename:basename(".") be changed to return the
>parent directory rather than ParentDir ++ "/.".
Hm, I assume you mean absname here, not basename? Otherwise s/dir/base/
on Miguel's message... The dirname and basename functions are purely
For absname this change seems reasonable, especially since absname
already does remove "intermediate" occurrences of ".". There are some
instances where "/foo/bar" and "/foo/bar/." can mean different things
though (notably if "bar" is a symlink pointing to a directory). And you
could use filename:absname("") instead...
More information about the erlang-questions