How to write to middle of a file in C++?

后端 未结 3 1322
北恋
北恋 2020-11-30 12:57

I think this should be quite simple, but my googling didn\'t help so far... I need to write to an existing file in C++, but not necessarily at the end of the file.

I

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 13:30

    Based on my basic knowledge of Operating systems, I would say it is not possible. I mean it is not impossible to make an OS that can allow such functionality with current storage technologies, but doing so would always lead to wastage of space in segments.

    But I am not aware of any technology that can allow that. Although some cloud-based DataBases do use such kinds of functionally (like inserting content in middle of a file), but they are made specifically for that DBMS software, with very specifically targeted hardware, and they may also have some custom-built kernels to perform such tasks.

提交回复
热议问题