On Tue, 08/12 08:03, 吴兴博 wrote: > I carefully read your reply and thought of it carefully. I'm sorry that > when I said "I get it" I actually meant "I believe you" but not "I > understand it". > The problem would not come from cp or rsync -- It's not their fault. They > just have no way to make it right. > The real reason of it would be that filesystems have different allocation > unit size. > > For example, a file is of 16KB in appearance, and the 4KB-12KB of it is a > hole (0KB-4KB and 12KB-16KB has valid data). > The FS held it has 4KB block size, so it *could* be allocated like this. > Copying this file to a filesystem of 16KB block size would cause the entire > 16KB filled with data, to be specific, the hole is filled with zero and > cp/rsync have NO way to make difference. > > That's not a engineering issue of cp/rsync. It's a real issue cause by the > fact that (most) filesystems have configurable block size. >
Correct. It's not an fault of any party, because there is no contract on this part at all. What you suggested is not a good use case of the file system hole. Fam