safely.lisp: More on the CLisp RENAME-FILE mess.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 17 Jul 2011 20:51:16 +0000 (21:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 17 Jul 2011 20:51:16 +0000 (21:51 +0100)
commit9224720f63a3a3f810ce03dc4018e23a0c6d8492
treeb63b532c8ae4b028e870d9d5dc61b7da91d6f887
parent1a50efd8a9e976bf16a29ce381ea38c6b9a39ea1
safely.lisp: More on the CLisp RENAME-FILE mess.

The :IF-EXISTS option is only in very new versions of CLisp.  It turns
out that the bizarre double-pathname-merging bug in POSIX:COPY-FILE
doesn't cause trouble if the source is absolute (unsurprising, in
retrospect) so I could use TRUENAME to dig my way out of this mess; but
COPY-FILE will clobber the target file before looking to see whether the
source succeeds (unless persuaded otherwise with :IF-EXISTS, which only
works if RENAME-FILE understands that option).

Give up, and use rename(2) through the FFI.
safely.lisp