The fastest way to copy a file?
alexsaveau.dev
alexsaveau.dev
Anyway long story short, the best thing we found (for Linux) was Linus's own advice linked from here: https://stackoverflow.com/a/3756466 To do is to combine this with io_uring.
https://man7.org/linux/man-pages/man2/copy_file_range.2.html
Go has had some troubles because they used that with their `io.Copy()`: https://lwn.net/ml/linux-kernel/20210212044405.4120619-1-drinkcat@chromium.org/
Article about `copy_file_range`
https://lwn.net/Articles/846403/Btw. https://stdrs.dev/nightly/x86_64-unknown-linux-gnu/std/sys/u...
As the name says, it only works on regular files.
is a bit misleading, it does only work on regular files in the same filesystem when using a kernel older than 5.3. EXDEV The files referred to by fd_in and fd_out are not on the same mounted filesystem (pre Linux 5.3).- copyfile: https://developer.apple.com/library/archive/documentation/Sy...
- clonefile: https://www.unix.com/man-page/mojave/2/clonefile/
> uses copy acceleration when the file system supports it
I thought that refers to clone_file_range, but that doesn't seem to be the case. As such, I would recommend looking into that, I believe it's supported on btrfs and XFS currently in Linux.
There is also sendfile, but it's probably the same as copy_file_range.
As I wrote in another post, that syscall had already caused some trouble for Go, they used it with `io.Copy()`
You can only copy 'non special' files _in _the_same_filesystem_ (that part is missing in Rust's documentioan) with it. https://stdrs.dev/nightly/x86_64-unknown-linux-gnu/std/sys/u...
https://docs.microsoft.com/en-us/windows-hardware/drivers/st...
Isn't that something FTP, a 50-year-old protocol can do too?