Skip to content

zstd 1.5.0 no longer preserves modification time #2739

@0x9fff00

Description

@0x9fff00

Describe the bug
In zstd 1.4.9 and earlier, the modification time of a compressed file was the same as the uncompressed file, but in 1.5.0 this is no longer the case and the modification time is set to the compression time.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file: touch testfile
  2. Compress it: zstd testfile
  3. Compare the modification times: stat testfile{,.zst}

Using zstd 1.5.0, testfile and testfile.zst have different modification times.

Expected behavior
The modification times would be the same, like in zstd 1.4.9. gzip, bzip2 and xz also have this behavior.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version: zstd 1.5.0
  • Compiler: gcc 11.1.0
  • Flags: CFLAGS="-march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection", CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS", LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
  • Build system: Makefile

Additional context
git bisect shows that b87f97b is the first commit with this issue. The associated pull request (#2525) only mentions file permissions and not modification times.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions