From: Bruno H. <br...@cl...> - 2004-01-12 12:16:03
|
Hi all, In the docs of 19.1.1. Directory canonicalization I read: > 2. "..", "*", and "**" are converted to :UP, :WILD and :WILD-INFERIORS, > respectively > 3. patterns foo/../ are collapsed But this is inconsistent on Unix! CLHS section 19.2.2.4.3 explains what :UP means: :up Go upward in directory structure (semantic) :back Go upward in directory structure (syntactic) The meaning of ".." on Unix is "parent directory", i.e. :UP. (But newbie users are confused by the behaviour of "cd .." in some shells.) So (2) is correct, but collapsing "foo/../" is not the right thing to do. "foo" may be a symlink. And you aren't allowed to access the filesystem during parsing of filenames. Therefore collapsing of ".." is an operation that must be delayed until TRUENAME or OPEN or similar functions are called. clisp-2.27 and earlier did it right: (pathname-directory (parse-namestring "foo/../bar/baz/bla")) (:RELATIVE "foo" ".." "bar" "baz") clisp-2.28 and the more recent ones do it wrong: (pathname-directory (parse-namestring "foo/../bar/baz/bla")) (:RELATIVE "bar" "baz") Bruno |