coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

cp --debug should show when `sparse detection: SEEK_HOLE`

Open sylvestre opened this issue 1 year ago • 3 comments

with our:

$ truncate -s16M file.sparse_
$ ./target/debug/cp --debug --reflink=never file.sparse_ file.sparse_.cp    
'file.sparse_' -> 'file.sparse_.cp'
copy offload: unknown, reflink: no, sparse detection: no

with GNU:

$ truncate -s16M file.sparse_
$ /usr/bin/cp --debug --reflink=never file.sparse_ file.sparse_.cp
'file.sparse_' -> 'file.sparse_.cp'
copy offload: unknown, reflink: no, sparse detection: SEEK_HOLE

Used https://github.com/coreutils/coreutils/blob/master/init.cfg#L555 and will unblock some tests like GNU/tests/cp/sparse-2

We have the definition but I don't think it is used anywhere: https://github.com/uutils/coreutils/blob/be822009f01b9436befb3389c002ffc7b54bd2eb/src/uu/cp/src/cp.rs#L305

sylvestre avatar Dec 24 '23 11:12 sylvestre

Hello @sylvestre . I would like to work on this issue. Can you please guide me a bit on what files need to be changed as I am new to this.

shinigami-777 avatar Dec 24 '23 20:12 shinigami-777

With pleasure. Finding the file is part of the exercice :) should not be hard

sylvestre avatar Dec 24 '23 22:12 sylvestre

I'm not sure if I'm hallucinating, but when I last contributed, I think there was a method to hot-reload to test these things. Can I just install, rebuild and reinstall to see if it works as I expect?

AbhinavMir avatar Jan 18 '24 09:01 AbhinavMir