I don't know lisp at all, but I was more concerned about the ":if-exists :overwrite". Does this "overwrite" take place on open by trucating the file immediately, or does it simply leave the file pointer at zero, rather than openning in append mode?
- jim On Fri, 30 Jun 2006 02:13:13 +0000 "n a" <[EMAIL PROTECTED]> wrote: > > > >then again, you could do this in common lisp without having two copies of > >the file or having to have the whole file in memory by using two seperate > >filestreams on the same file > > > >(with-open-file (in #p"/path/to/bigfile" :direction :input) > > (with-open-file (out #p"/path/to/bigfile" > > :direction :output > > :if-exists :overwrite) > > (dotimes (i 300) (read-line in)) > > (handler-case > > (loop (princ (read-line in) out) (terpri out)) > > (error ())) > > I'm not sure anyone cares, but I just realized this would still leave the > last 300 lines duplicated at the end of the document... off the top of my > head I don't know if it's possible to force an eof on an output file, I'll > have to ask someone... it may in fact not be possible to get the desired > effect of destructively rewriting the doc in it's own puddle of bits > > Nick > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > _______________________________________________ > RLUG mailing list > [email protected] > http://lists.rlug.org/mailman/listinfo/rlug > _______________________________________________ RLUG mailing list [email protected] http://lists.rlug.org/mailman/listinfo/rlug
