4

I need to create an output file for a program in lisp, but I cannot get dribble to properly record my output. I'm using lispbox and my buffer looks like this when I try to use dribble:

(dribble "output.txt")
"output.txt"
... Calls to functions I defined
... I've tried entering expressions, values, strings
(dribble)
NIL

But when I go to output.txt I have an empty file that is 0 bytes. I'm pulling my hair out because I'm having trouble finding the answer and it seems like my computer is the problem. Any thoughts on where to start troubleshooting this (or solutions) would be greatly appreciated.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
  • Are you sure the "output.txt" file was created by this dribble call?Try giving DRIBBLE a full path to the file. – sds Oct 15 '12 at 16:56
  • Another thing is that you should try the same without lispbox, in vanilla clisp. – sds Nov 29 '12 at 18:13

1 Answers1

3

I'd bet dribble is rebinding some streams that are different from the ones being used by SLIME to get output to and from the REPL. (Issue DRIBBLE-TECHNIQUE might be worth reading.)

Your solution depends on what your are doing. If you just want a record of your interactions with Lisp, remember that emacs is a text editor and you can save the contents of the REPL buffer to a file or copy an excerpt.

If you want to write a program that saves output to a file, dribble is not a good mechanism for this. Have a look at open, close, print, format, and with-open-file.

Samuel Edwin Ward
  • 6,526
  • 3
  • 34
  • 62