Thanks for the replies... and I did think of some of the things already mentioned here. Regarding disk full, I do have this as a basic assumption, near to "plug in the PC". Lets assume that if disk is full, I cannot do anything. Same as "new fails" - it's OK for the app to die, as I cannot do anything to remedy this.
Another option I was thinking... is writing writing all the data received into file in fdisk, and them append a "u32" which means "how much did I read". By default is "0", meaning all is unread. To append, I
fopen()
fopen()
To copy to clipboard, switch view to plain text mode
, and then
fseek( filesize - sizeOf(u32))
fseek( filesize - sizeOf(u32))
To copy to clipboard, switch view to plain text mode
, read the unread offset, and then fseek() again, append new data and write that offset again. When "consuming" data from the file, I just need to fseek() and then write only 8 bytes. IMHO this should be less IO then using SQlite. As this file is only managed by my app, I don't think this might break.
What do you guys think, what can break with this setup?
(2nd option is SQLite)
Bookmarks