Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Circular buffer for file

Circular buffer for file

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dansveen
    wrote on last edited by
    #1

    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.

    CPalliniC 1 Reply Last reply
    0
    • D Dansveen

      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.

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      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, if next == 4 then the file having fname[4] (if any) is deleted and fname[4] is assigned with the name of a newly created file. Then next is incremented (and set to zero if greater than 9). Hope it makes sense.

      Veni, vidi, vici.

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups