Subject: Re: File renaming misery
From: (Rob Warnock)
Date: Fri, 12 May 2006 01:56:17 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Steven E. Harris <> wrote:
| Mark Wooding <> writes:
| > Is there a sensible way of doing what I want, in Common Lisp?  
| I got the following to work in LispWorks, more through experimentation
| than understanding:
| > (rename-file (make-pathname :directory '(:absolute "temp")
|                               :name "foo" :type "new")
|                (make-pathname :type :unspecific))
| #P"C:/temp/foo"
| #P"C:/temp/"
| #P"C:/temp/foo"

It also works in CMUCL [on Linux or FreeBSD, at least]:

    cmu> (rename-file ""
		      (make-pathname :name "foo" :type :unspecific))


But as you saw, I'm sure, Pascal B. warned that this use
of :UNSPECIFIC is non-portable. However, CLHS
*does* say: :UNSPECIFIC as a Component Value
    However, a conforming program can, if it is careful, successfully
    manipulate user-supplied data which contains or refers to non-portable
    pathname components.
    When writing the value of any pathname component, the consequences
    are undefined if :unspecific is given for a pathname in a file system
    for which it does not make sense.

But in a file system for which it *DOES* make sense...  ;-}  ;-}


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607