Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Ref-linking ZIP archiver for CoW filesystems

NotificationsYou must be signed in to change notification settings

koro666/zipref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zipref is a script that generates (uncompressed) ZIP files on copy-on-write filesystems by ref-linking the contents of the source files inside the archive.

It does so by (ab)using the fact that the ZIP format allows padding between entries to carefully align the file header for each entry so that the data starts at an offset which is a multiple of block size. This allows cloning the data from the source file directly.

The resulting archive is a proper ZIP64 archive and should barely take up any extra space. It has been tested to extract properly in WinRAR,7z andunzip.

Note that the process is not instantaneous: the data still has to be read in order to compute the CRC32 for each entry. Additionally, if the cloneioctl fails, the script will revert to copying the data manually.

Usage

The script takes the name of the output archive as first argument, as well as the name of files to add as additional arguments. It's possible to use@ to specify a file containing a list of files, and to use- to read said list from standard input.

The output file must not exist already, and the input files are addedas-is in the specified order, using their paths verbatim as they are specified.

Some examples:

# Specify file list on the command linezipref output.zip*.mp3# Specify file list from an input filezipref output.zip @files.txt# Specify file list from standard inputfind -type f| zipref output.zip

Additionally, it is possible to generate a reproducible archive using theSOURCE_DATE_EPOCH environment variable:

# Generate reproducible archiveexport TZ=UTCexport SOURCE_DATE_EPOCH=1600000000# or $(stat -c %Y reference_file)find -type f| sort -f| zipref output.zip

References

About

Ref-linking ZIP archiver for CoW filesystems

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp