search for: skipholes

Displaying 3 results from an estimated 3 matches for "skipholes".

2025 Apr 04
2
Support for transferring sparse files via scp/sftp correctly?
...y copied that part of the file. > > > > Damien pointed out that it's possible to do a reasonable but not perfect sparse file support by memcmp'ing your existing file buffer with a block of zeros and skipping the write if it matches. OpenBSD's cp(1) does this (look for "skipholes"): https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/cp/utils.c?annotate=HEAD. This should not be done. Either a system has SEEK_DATA/SEEK_HOLE, Win32 (Windows&ReactOS) FSCTL_QUERY_ALLOCATED_RANGES, or just copy all bytes. The misunderstanding is that sequences of 0x00 bytes are automatic...
2025 Apr 05
1
Support for transferring sparse files via scp/sftp correctly?
...gt; wrote: > [...] > > > Damien pointed out that it's possible to do a reasonable but not > perfect sparse file support by memcmp'ing your existing file buffer with a > block of zeros and skipping the write if it matches. OpenBSD's cp(1) does > this (look for "skipholes"): > https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/cp/utils.c?annotate=HEAD > . > > This should not be done. Either a system has SEEK_DATA/SEEK_HOLE, > Win32 (Windows&ReactOS) FSCTL_QUERY_ALLOCATED_RANGES, or just copy all > bytes. If there's a protocol extensio...
2025 Apr 04
1
Support for transferring sparse files via scp/sftp correctly?
...ou had already copied that part of the file. > Damien pointed out that it's possible to do a reasonable but not perfect sparse file support by memcmp'ing your existing file buffer with a block of zeros and skipping the write if it matches. OpenBSD's cp(1) does this (look for "skipholes"): https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/cp/utils.c?annotate=HEAD. Yeah - I?ve thought about implementing something like this as a second pass, where OSes with the ability to return ranges will tell you what parts of the local file not to read at all, but then within the ranges wh...