Circular buffer for file
-
HI all I'm trying to implement a software that create backup files. The backup are created until a maximum of backup files defined, in my case are 10 files. After that I get the oldest backup file and overwrite. But I have somes question about what use, I tried use Circular buffer but I don't know how to use for files. Anybody can help me. Thank you.
-
HI all I'm trying to implement a software that create backup files. The backup are created until a maximum of backup files defined, in my case are 10 files. After that I get the oldest backup file and overwrite. But I have somes question about what use, I tried use Circular buffer but I don't know how to use for files. Anybody can help me. Thank you.
Your circular buffer may contain, for instance the file names, e.g.
fname[0]
fname[1]
...
fname[9]With a
next
variable holding next item in the circular buffer. For instance, ifnext == 4
then the file havingfname[4]
(if any) is deleted andfname[4]
is assigned with the name of a newly created file. Thennext
is incremented (and set to zero if greater than9
). Hope it makes sense.Veni, vidi, vici.