rename-file-overwriting-target in clisp problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
Fix Released
|
Medium
|
Faré |
Bug Description
This function has a special case for clisp:
(defun rename-
#+clisp ;; But for a bug in CLISP 2.48, we should use :if-exists :overwrite and be atomic
(posix:
#-clisp
(rename-file source target
This code causes build problems in clisp because when asdf is distributed with clisp, it is built before the posix module is available.
Also, nobody uses 2.48 anymore, so I think you can safely assume 2.49.
It would seem that a more portable (but not atomic) solution would be
(defun rename-
#-clozure (when (probe-file target) (delete-file target))
(rename-file source target
Alternatively, the CLISP solution would be
#+clisp
(progn (require "syscalls")
OK. Is there a simple way to detect whether the :if-exists :overwrite option is available?
If I try to use it on my Ubuntu 12.04.3 LTS's "GNU CLISP 2.49 (2010-07-07)", I get:
(posix:copy-file "/tmp/b" "/tmp/c" :method :rename :if-exists :overwrite)
*** - EVAL/APPLY: Too many arguments (4 instead of at most 2) given to RENAME-FILE