New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] why the zstd don't preserve original file name and modification date? #1402
Comments
zstd itself only compresses a stream of bytes - the file content. To preserve metadata (among other things), something like |
yes, we can use |
Note that you can directly extract a .tar.zst by piping zstd and tar, without the need for intermediate file:
|
Yes, but the problem is that to get a real file name, it's perms and modification date we should decompress the whole file. |
Tar can read metadata and stop the reader, which will stop zstd after decoding the very beginning of the file:
|
Zstd does attempt to preserve permissions and modification date, starting with zstd version 1.1.2, released in December 2016. However, it isn't enabled on all platforms. If the latest zstd version isn't preserving file permissions for you, please tell us about your platform, and how you're invoking zstd, so we can help debug the issue. |
Hi @terrelln
|
@stokito zstd doesn't store the permissions in the format, we simply copy the permissions and modification times from If you want to store the permissions in the format, you'll have to use a tool like tar. |
Storing the original filename is not a feature but a design hack that shouldn't be copied. The only reason gzip does that is because it dates back to DOS times with 8.3 names. There you couldn't just append |
I notice this has been closed for ~3yrs, let me know if I should open a new issue.
[Captain Obvious points out timestamp of foo is the current time (when unzstd ran) and differs from foo.orig.] Noting 'touch' uses the utimensat system call, I also notice no calls by unzstd when traced with: |
@cschanzlenist, yes, this is a bug that was introduced in v1.5.0: #2739. We've landed a fix that will go out in the next release: #2742. Thanks for the report and sorry for the churn! |
Is any reason why this wasn't added? Or maybe there is some plans to implement this?
The text was updated successfully, but these errors were encountered: