opening it up with Common Lisp

Favorite weblogs

Lisp Related

Bill Clementson

Finding Lisp

Lemonodor

Lispmeister.com

Planet Lisp

Politics

Orcinus

Talking Points Memo

This Modern World

Working for Change

Other home

Polliblog

Recent Readings

Book review: Darwinia
Reviewed: Friday, August 11, 2006

Summer reading: Spin
Reviewed: Saturday, August 5, 2006

Runner
Reviewed: Tuesday, July 18, 2006

the Omnivoire's Delimma
Reviewed: Wednesday, July 12, 2006

the Golem's Eye
Reviewed: Wednesday, May 31, 2006





tinderbox
 width=

Problems appending in clisp
Wednesday, January 11, 2006

Before my recent hardware conniptions, I was tring to get ASDF-Install-Tester to run in clisp on OS X (or perhaps on clisp in OS X... under OS X?!). Unfortunately, I ran into some pretty bizarre behavior trying to append to existing files. Here is a test case on the off chance that someone reading this is also running the Darwin Ports version of clisp 2.37 under OS X.

When I run the following code in my version of clisp (complete version details here)

(in-package common-lisp-user)

(let ((working (user-homedir-pathname)))
  (with-open-file (s (make-pathname
                      :name "talk"
                      :type "tome"
                      :defaults working)
                     :if-exists :append
                     :if-does-not-exist :create
                     :direction :output)
    (format s "~%Hello"))

  (with-open-file (s (make-pathname
                      :name "talk"
                      :type "tome"
                      :defaults working)
                     :if-exists :append
                     :if-does-not-exist :create
                     :direction :output)
    (format s "~%Goodbye")))

The file created looks like this (using od -c)

[billy-pilgrim:~] gwking% od -c talk.tome
0000000   \0  \0  \0  \0  \0  \0  \n   G   o   o   d   b   y   e
0000016

And thanks just not right. My best guess is that someone figured removing all the ones from the first part of the file would make seeking to end much faster (kind of like removing all the hurdles from a race course...). <smile>


|

Home | About | Quotes | Recent | Archives

Copyright -- Gary Warren King, 2004 - 2006