Documentation
¶
Overview ¶
Package sparsefile copies files while preserving holes.
The biggest thing atelet copies is a guest memory image, which is mostly unallocated: a plain io.Copy reads holes as zeroes and writes them as data, inflating a snapshot to its full logical size. That costs disk on every copy, and it destroys the sparseness later stages rely on to tell which parts of guest RAM actually hold anything.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy copies the open handle src into the open handle dst, preserving holes where it can, and returns the number of logical bytes copied. Neither handle is closed, and both handles' offsets are clobbered. It exists for callers that must control how the endpoints are opened — e.g. a source opened before its directory entry could vanish, or a destination created with O_EXCL.
dst must be empty (freshly created): holes are never written, so any pre-existing destination bytes would show through them, silently corrupting the copy. A non-empty destination is rejected up front.
Types ¶
This section is empty.