gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > non GBa coding question - writing to files

#20485 - yaustar - Wed May 12, 2004 3:14 am

I know how to write to files but the pointer always starts at the beginning of the file..

Is there a way to open a file, go to the end of the file, write, and close it again?

Many thanks
_________________
[Blog] [Portfolio]

#20486 - DiscoStew - Wed May 12, 2004 3:37 am

That all depends, what libraries are you using?
_________________
DS - It's all about DiscoStew

#20488 - yaustar - Wed May 12, 2004 4:07 am

stdio.h i think at present..
_________________
[Blog] [Portfolio]

#20496 - tepples - Wed May 12, 2004 4:47 am

You could fopen() the file in append mode.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#20497 - yaustar - Wed May 12, 2004 4:49 am

There's an append option?? Didnt know that.. thanks
_________________
[Blog] [Portfolio]

#20499 - poslundc - Wed May 12, 2004 5:00 am

mode "a" - all write instructions append to end of file
mode "a+" - write instructions append, also allows reading (from the beginning) of the file

Dan.