[Coco] basic09 - append to file

gene heskett gheskett at wdtv.com
Tue Jan 11 19:15:16 EST 2011


On Tuesday, January 11, 2011 06:50:52 pm Aaron Wolfe did opine:

> Thanks.. I tried: SEEK #fp, EOF
> that seems to be bad syntax.  there is an EOF() function but that is
> boolean, seems to just compare current file pointer to the file size
> somehow.  If i could just read the value it is comparing, and use that
> as the seek argument, should work.  but, I'm not sure how to get that
> value.  I can't really be reading the entire file just to get to the
> end, too wasteful of resources for this application.
> 
Humm, I'd swear on a stack of bibles I used it way back when.

I also know that I have a copy of the Dibble book, Inside basic09, but I 
just spent 15 minutes touring the first two layers of cardboard storage 
boxes in the basement without finding it.  That info is in the file 
descriptors first $10 bytes I believe, so it should be retrievable but 
would have to involve opening the working disk raw and chasing thru the 
directory data to locate the filenam, and from the 3 byte locatio there, 
seek to that fd sector and read it from there.  I will  work on excavating 
it again tomorrow when I can move the stuff on top someplace else and get 
to 4 or 5 more of those file storage boxes.  The problem is finding that 
someplace else in that disaster area.

Got it I think, fire up a 'syscall' and do an ss.siz, its on the bottom of 
page 8-113 in the level2 manual, it reports the currently open files size 
and one can then seek to that position, which would be an eof error if you 
tried to read another byte.


> On Tue, Jan 11, 2011 at 4:50 PM, gene heskett <gheskett at wdtv.com> wrote:
> > On Tuesday, January 11, 2011 04:44:19 pm Aaron Wolfe did opine:
> >> Maybe I'm missing it.. is there an easy way to append to a file (like
> >> a log file) in basic09? �all the print,write,put statements seem to
> >> write at the current file pointer which is 0 on open. �any trick or
> >> simple way to seek to the end?
> > 
> > I believe one can seek(EOF,#path) or something similar in basic09.
> > �Failing that, open in update mode, then read to a throwaway buffer
> > till it hits eof, don't close, but start writing at eof. �But that
> > would be a kludge only if the seek doesn't work. �ISTR using it with
> > the seek half an eon ago. ;-)
> > 
> > --
> > Cheers, Gene
> > "There are four boxes to be used in defense of liberty:
> > �soap, ballot, jury, and ammo. Please use in that order."
> > -Ed Howdershelt (Author)
> > Never raise your hand to your children -- it leaves your midsection
> > unprotected.
> > � � � � � � � �-- Robert Orben
> > 
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > http://five.pairlist.net/mailman/listinfo/coco
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco


-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
The world is moving so fast these days that the man who says it can't be
done is generally interrupted by someone doing it.
		-- E. Hubbard



More information about the Coco mailing list