I get a strange error when calling osicat-posix:mkdir on an already existing directory in Clozure.
(osicat-posix:mkdir "/this/directory/exists/" #o777)
An error is thrown:
--------------------------------------------
#<error printing EEXIST #x1985838E> [Condition of type OSICAT-POSIX:EEXIST]
Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [*ABORT] Return to SLIME's top level. 2: [ABORT-BREAK] Reset this thread 3: [ABORT] Kill this thread
Backtrace: 0: (OSICAT-POSIX:POSIX-ERROR 17 NIL OSICAT-POSIX:MKDIR) 1: (CCL::CALL-CHECK-REGS OSICAT-POSIX:MKDIR #P"/home/viper/tmp/bar/" 511) 2: (CCL::CHEAP-EVAL (OSICAT-POSIX:MKDIR (MERGE-PATHNAMES "bar/" "/home/viper/tmp/") 511)) 3: (SWANK::EVAL-REGION "(osicat-posix:mkdir (merge-pathnames "bar/" "/home/viper/tmp/") #o777)\n")
--------------------------------------------
Select restart 1 (abort), another error comes up:
--------------------------------------------
Illegal :UTF-8 character starting at position 0. [Condition of type BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE]
Restarts: 0: [*ABORT] Return to SLIME's top level. 1: [ABORT-BREAK] Reset this thread 2: [ABORT] Kill this thread
Backtrace: 0: (BABEL-ENCODINGS::UTF-8-DECODER #<A Foreign Pointer [stack-allocated] #x7F60D08> 0 3 "^@^@^@" 0) 1: (CFFI:FOREIGN-STRING-TO-LISP #<A Foreign Pointer [stack-allocated] #x7F60D08> :OFFSET 0 :COUNT NIL :MAX-CHARS 16777215 :ENCODING :UTF-8) 2: (OSICAT-POSIX:STRERROR 17) 3: ((:INTERNAL (PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)))) 4: (CCL::%PRINT-UNREADABLE-OBJECT #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> #<STRING-OUTPUT-STREAM #x1979BB66> T NIL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL ..)) 5: (#<STANDARD-METHOD PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)> #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> #<STRING-OUTPUT-STREAM #x1979BB66>) 6: (CCL::%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)> . 4670269)) 7: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT :AROUND (T T)> #<STANDARD-METHOD PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)>) 4670269) 8: (NIL #<Unknown Arguments>) 9: (CCL::WRITE-A-FROB #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> #<STRING-OUTPUT-STREAM #x1979BB66> 536870911 NIL) 10: (CCL::WRITE-INTERNAL #<STRING-OUTPUT-STREAM #x1979BB66> #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> 536870911 NIL) 11: (CCL::WRITE-1 #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> #<STRING-OUTPUT-STREAM #x1979BB66> 536870911) 12: (PRIN1 #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E> #<STRING-OUTPUT-STREAM #x1979BB66>) 13: (PRIN1-TO-STRING #<EEXIST #<error printing OSICAT-POSIX:EEXIST #x19797F2E>) 14: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(osicat-posix:mkdir (merge-pathnames "bar/" "/home/viper/tmp/") #o777)\n") "COMMON-LISP-USER" 63)
--------------------------------------------
This doesn't come up in SBCL or CLISP - they both print the EEXIST error normally.
The environment is Clozure Version 1.9-dev-r15251M (LinuxX8632) on SLIME on Ubuntu, both locale and ccl:*default-file-character-encoding* are utf-8.
Vladimir
On 16 April 2012 02:29, Vladimir Sedach vsedach@gmail.com wrote:
(osicat-posix:mkdir "/this/directory/exists/" #o777)
Given that MKDIR is defined via DEFSYSCALL, which is a trivial wrapper around CFFI:DEFCFUN, I suspect this is a CFFI or CCL issue.
If you inspect the condition, I suspect you will find an unbound slot.
Cheers,
-- Nikodemus