如何动态输出替换了一些字节的文件内容?

How to dynamic output a file content with replaced some bytes?

I used a fuse plugin named 'concatfs'

It can virtual merge some file with a specific filename like xxx-concat-.mkv, and this file's content is a TEXT:

1.mkv
2.mkv
3.mkv

system reads xxx-concat-.mkv, it outputs a merged file with 1.mkv 2.mkv .... but the files are not merged in fact, it's a virtual output.

那么,我的问题是:

1.zip

0xa 4 replaced-4bytes-binary-content

0x1111 10 replaced-10bytes-binary-content

你有什么建议吗?

Thanks a lot, and sorry for my english.

使用 merged-fuse 虚拟 merge/replace 文件 (C++ 11)

https://github.com/fly-studio/merged-fuse

例子

1.txt

12345678

2.txt

abcdefghi

创建一个名为 1-merged-.txt

的文件

-merged-是文件名中的特殊字

内容为JSON格式

[
    {
        "path": "1.txt"
    },
    {
        "path": "2.txt",
        "replaces": [
             {
                 "offset": 2,
                 "length": 2,
                 "content": "MjE="
             }
        ]
    }
]

cat 1-merged-.txt时,输出:

12345678ab12efghi

可以看到文件被合并(虚拟),内容被替换:

cd 替换为 12