On Nov 23 23:36, Cedric Blancher via Cygwin wrote:
> Linux has fallocate(fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, ...)
> to punch a hole into a file, i.e. deallocate the blocks given and make
> the file a "sparse file".

We don't support the Linux-specific fallocate(2) call, only ftruncate(2)
and posix_fallocate(3).  Patches, as usual, thoughtfully considered.

> But how can I do that with the Cygwin API? Does anyone have an example
> for Cygwin, which is the Win equivalent to Linux fallocate(fd,
> FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, 1048576, 2097152);?
> 
> I tried with Cygwin 3.5, but the file was not sparse after that.

Do you remember the discussion in August, starting here:
https://cygwin.com/pipermail/cygwin-developers/2023-August/012664.html
especially:
https://cygwin.com/pipermail/cygwin-developers/2023-August/012679.html

So, did you set the sparse mount option per
https://cygwin.com/cygwin-ug-net/using.html#mount-table
?

Also, chattr -S, which is independent from the mount option "sparse":
https://cygwin.com/cygwin-ug-net/chattr.html


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to