[Coco] basic09 - append to file

L. Curtis Boyle curtisboyle at sasktel.net
Tue Jan 11 17:33:17 EST 2011


I think there is a syscall that lets you get the file size that you could use. (Don't have the details in front of me at the moment).

L. Curtis Boyle
curtisboyle at sasktel.net



On Jan 11, 2011, at 4:24 PM, Aaron Wolfe wrote:

> 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.
> 
> 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




More information about the Coco mailing list