View Single Post
  #13   Spotlight this post!  
Unread 28-01-2014, 13:20
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 114
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: File IO without overwriting file

If we can't get a generic append function working, we'll probably go with multiple incrementing log files, but there are some downsides:

-Since the robot can terminate unexpectedly, we have to flush our buffer fairly often to make sure we don't lose data due to a power failure or unexpected reboot
-Too many small files is a pain to read and process, so we would need to find a balance

I'll try to get more detail about our current IO exception (also, does anybody else have that problem where FileConnection.fileSize() returns an enormous number?), and if that doesn't work out, implement a solution like joelg236's. We already had some code that buffered about 7.9k worth of logs before flushing to disk, so we shouldn't be spending too much time on IO.
Reply With Quote