#file-copy #cow #copy #btrfs #reflink #xfs

reflink-copy

copy-on-write mechanism on supported file systems

14 releases

new 0.1.17 Apr 21, 2024
0.1.15 Mar 1, 2024
0.1.14 Dec 11, 2023
0.1.12 Nov 17, 2023
0.1.5 Jul 12, 2023

#116 in Filesystem

Download history 8864/week @ 2024-01-01 9028/week @ 2024-01-08 10086/week @ 2024-01-15 9208/week @ 2024-01-22 9591/week @ 2024-01-29 6236/week @ 2024-02-05 7856/week @ 2024-02-12 10002/week @ 2024-02-19 11104/week @ 2024-02-26 13361/week @ 2024-03-04 11387/week @ 2024-03-11 11822/week @ 2024-03-18 12750/week @ 2024-03-25 11438/week @ 2024-04-01 14683/week @ 2024-04-08 14263/week @ 2024-04-15

54,309 downloads per month
Used in 66 crates (8 directly)

MIT/Apache

23KB
407 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–44MB
~649K SLoC