mxmlnkn / ratarmount

Access large archives as a filesystem efficiently, e.g., TAR, RAR, ZIP, GZ, BZ2, XZ, ZSTD archives
MIT License
709 stars 36 forks source link

currently, only uncompressed tar can be writable? #120

Open BingoKingo opened 1 year ago

BingoKingo commented 1 year ago

I tried, but renaming a file in tar is just duplicate a new one with new name after commit. Can I put the renamed commit-overlay folder along with tar file by default without defining a new folder?

mxmlnkn commented 1 year ago

Unfortunately, you exactly pinpointed a todo in this feature: https://github.com/mxmlnkn/ratarmount/blob/ea43572dfbac4770a27ef2169f72ff73ee4a4ae9/ratarmount.py#L1536-L1538

And renaming is exactly one of the operations that is difficult. Other operations like modifying an existing file, could theoretically be implemented by simply appending the new file version and leaving the old file version in the TAR, even if that is not exactly space-saving.

Pull requests are welcome. Else, I might take another look in the coming months at using Python's tarfile module instead of GNU tar like the ToDo comment states.