ID:157148
 
Hey, I'm wondering if it's possible to append stuff to existing BYOND savefiles? I've only really used the new(savefile) syntax before and that just overwrites them..
If you put values in a specific key (F["KEY"] << value) then it won't override different keys. If you just do it by order (F << value) then it'll obviously have to override when you open the savefile again. You can move to the end of the buffer (and thus start appending) by setting F.eof to 1, but there's not really a great reason for doing so.
In response to Garthor (#1)
Great thanks, I might just do the F.eof thing because each time I read/write from/to the savefile it gets/puts a list in there and I only want to save whatever is in the list that has not been saved yet. To make saving the list shorter, or not needed at all if it hasn't changed since it was loaded.
In response to Sprin (#2)
If you are saving an actual list object, then it doesn't matter because it'll write the whole thing anyway.

If you are saving a list full of objects individually, then you're effectively restricted to never removing anything from the list (well, it's possible, but rather a lot of work).