3 ms·
It sounds wrong to depend on the file length for correctness even on physical file systems. What if the file length shrinks during the copy? You need to just ke
by dataflow 6y ago
It sounds wrong to depend on the file length for correctness even on physical file systems. What if the file length shrinks during the copy? You need to just keep going until you can't anymore...
- cpuguy83 6y agoThat's assuming you want to copy the the whole thing. And even if you do want to do that, this is what you do with copy_file_range as well, just that in many cases you can do it with a single call instead of multiple read/write calls in addition to being able to take advantage of performance optimizations (such as reflinking).
- dataflow 6y ago> That's assuming you want to copy the the whole thing Right, but if you don't, then you definitely don't need to query the file length in the first place...