Skip to content

Differences between gzip and zstd #854

@ghost

Description

zstd on Linux: two observations

  1. If I start gzip to compress a large file and if I kill gzip using ^C, gzip will delete the output file before terminating. zstd currently doesn't do that. I think gzip's behavior is better, because it's better to have no output file than to have an incomplete or corrupted output file.

  2. When compressing or decompressing a file, zstd uses the system call below to create the output file (from strace):
    open("file.zst", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
    gzip and xz use similar system calls, but they use mode 0600. They switch the mode of the output file to the desired mode after the file was closed. Is there a reason why zstd uses 0666? I think 0600 would be better: don't allow read access to other users before the file is ready.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions