#file-copy #write-file #copy #cow #btrfs #data-file

reflink-copy

copy-on-write mechanism on supported file systems

17 releases

new 0.1.20 Nov 10, 2024
0.1.19 Jul 4, 2024
0.1.18 Jun 11, 2024
0.1.15 Mar 1, 2024
0.1.5 Jul 12, 2023

#72 in Filesystem

Download history 17318/week @ 2024-07-26 15621/week @ 2024-08-02 17710/week @ 2024-08-09 15361/week @ 2024-08-16 18790/week @ 2024-08-23 18954/week @ 2024-08-30 16181/week @ 2024-09-06 17293/week @ 2024-09-13 20731/week @ 2024-09-20 17733/week @ 2024-09-27 16871/week @ 2024-10-04 18895/week @ 2024-10-11 21590/week @ 2024-10-18 18000/week @ 2024-10-25 16788/week @ 2024-11-01 19370/week @ 2024-11-08

79,385 downloads per month
Used in 85 crates (11 directly)

MIT/Apache

29KB
515 lines

reflink-copy

Build

Cross-platform(!) COW reflink copy of files

Some file systems implement COW (copy on write) functionality in order to speed up file copies. On a high level, the new file does not actually get copied, but shares the same on-disk data with the source file. As soon as one of the files is modified, the actual copying is done by the underlying OS.

This library supports Linux, Android, OSX, ios and Windows. As soon as other OS support the functionality, support will be added. For implementation details, visit the docs.


lib.rs:

Some file systems implement COW (copy on write) functionality in order to speed up file copies. On a high level, the new file does not actually get copied, but shares the same on-disk data with the source file. As soon as one of the files is modified, the actual copying is done by the underlying OS.

This library exposes a single function, reflink, which attempts to copy a file using the underlying OSs' block cloning capabilities. The function signature is identical to std::fs::copy.

At the moment Linux, Android, OSX, iOS, and Windows are supported.

Note: On Windows, the integrity information features are only available on Windows Server editions starting from Windows Server 2012. Client versions of Windows do not support these features. More Information

As soon as other OSes support the functionality, support will be added.

Dependencies

~0–39MB
~606K SLoC