mirage / ocaml-tar

Pure OCaml library to read and write tar files
ISC License
54 stars 34 forks source link

Implement remove #108

Closed reynir closed 1 year ago

reynir commented 1 year ago

This implements remove with a big constraint: only the last file can be removed. Otherwise, Error `Append_only is returned. The reason is removing the last file only requires overwriting the header and the following block with zeroes whereas removing files at other positions require moving potentially large amounts of data.

I believe I also found an off-by-one error when computing end sectors which this fixes as well.

hannesm commented 1 year ago

thanks