How to create holes in files ?

Bob Eager rde at tavi.co.uk
Thu Sep 28 16:40:05 UTC 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Thu, 28 Sep 2017 17:26:09 +0200
Fabian Keil <freebsd-listen at fabiankeil.de> wrote:

> Ben RUBSON <ben.rubson at gmail.com> wrote:
> 
> > I'm trying to make holes in files in C.
> > Goal is to deallocate huge files on ZFS while (randomly) reading
> > them.  
> 
> My interpretation of the above is that you want to create holes
> without changing the file size and without affecting data that
> is located before or after the holes that you want to create.
> 
> Otherwise you could simply "deallocate" the content with
> truncate(1).

If he doesn't mind copying the files, dd(1) will do the job. However, I
expect that doesn't meet his criteria.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEVgdI2KeVldPAhUYaKBdf2az8e6gFAlnNJJQACgkQKBdf2az8
e6jwtQf/Wext9mpdighKYfsZVZ4mHUfDu8lPrb+CTc071kbASzS0bv36nVs6rvxZ
7J5jFP+EMA8xKA7WN2q1t8IZaiVVEZHoqp+NQojp13c0g7DtaKMHcCrZdesnYpQV
z9u0WxpZcCm/f6H+TvO8wlnYAXvAntB0nIA5R6UPTyMXcGSnjfDkg02Tzq+AKJ0s
ncXk4wXSRONMAnbCxHuY09v92rfciJv8VlvakGxFc20RzXqDuvKYsaFmk+gOuDBL
PMddOyWKUUWOcTApuDsij7Yq7wA7E256uV+iI+ndU+F8tXsLu0tOmMSBwh4EFopa
W9PaQvdzr6n9vHu2mxhZnVkNcUVyYw==
=dNq0
-----END PGP SIGNATURE-----


More information about the freebsd-fs mailing list