fwrite
#1

When I try to write with fwrite to a file, It just replaces what I've previously written, why?
Reply
#2

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
When I try to write with fwrite to a file, It just replaces what I've previously written, why?
Because this is what fwrite does. Use fread to read the file into a string, use format (like format(....,"%s\n%s, FileContent, StringToStoreInFile) ) and then use fwrite. It will replace the text that was in the file, with the stuff you've read from the file and the String you want to store in the file.
Reply
#3

That will create a huge ass string since I'm gonna log with fwrite? or Is there any better way to log stuff with?
Reply
#4

djson or dini?
Reply
#5

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
djson or dini?
You could modify dracoblues dini include (dini_Set). You can remove all those "key[]"-stuff from the function, cuz you dont need the keys, because you just want to log with it, if i understoof correctly.
Reply
#6

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
You could modify dracoblues dini include (dini_Set). You can remove all those "key[]"-stuff from the function, cuz you dont need the keys, because you just want to log with it, if i understoof correctly.
Yeah well I am going to use dini for other stuff :P
Reply
#7

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
When I try to write with fwrite to a file, It just replaces what I've previously written, why?
io_write or io_append?

Use io_append if you want to append, not replace text.
Reply
#8

Quote:
Originally Posted by LarzI
Посмотреть сообщение
io_write or io_append?

Use io_append if you want to append, not replace text.
Thank you very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)