Remove beginning of file without rewriting the whole file

前端 未结 3 1038
栀梦
栀梦 2020-12-29 06:21

I have an embedded Linux system, that stores data in a very large file, appending new data to the end. As the file size grows near filling available storage space, I need to

3条回答
  •  梦毁少年i
    2020-12-29 07:08

    The easiest solution for your old applications would be a FUSE filesystem which gives them access to the underlying file, but with the offset cyclically shifted. This would allow you to implement a ringbuffer at the physical level. The FUSE layer would be fairly trivial as it only needs to adjust all filepositions by a constant, modulo filesize.

提交回复
热议问题