X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 319F9385DC2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1701784418; bh=iFGjnmmML0tjJwz2/sAWsH/6248cpdRSBZJexpBZtlk=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cYU45Ie9qcCX3q0+7RPsmBeosTfW468z1d7AIt5ZKP3Gbj0fVagvwBTuj3FA8Y+ef OxE50dabNk9uBmRSaFnh2mIxNdUzlhdnupFS3c/ahqx+Mj1AlnLcdZmyWSk48YCAHo yPN4v/S9YdVYib0lfMTdBj7DNBcGM20tRpysUJoU= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C7E73858407 Date: Tue, 5 Dec 2023 14:53:01 +0100 To: cygwin AT cygwin DOT com Subject: Re: Cygwin api to punch a hole into a file? Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <33d4b0df-7a6a-40cf-85a2-9a4300198672 AT towo DOT net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <33d4b0df-7a6a-40cf-85a2-9a4300198672@towo.net> X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Dec 5 07:36, Thomas Wolff via Cygwin wrote: > > > Am 01.12.2023 um 12:02 schrieb Corinna Vinschen via Cygwin: > > On Dec 1 11:22, Cedric Blancher via Cygwin wrote: > > > Not all filesystems have a 128k block/stripe size, and certainly most > > > filesystems have smaller minimum hole sizes than 128k (e.g. 512bytes > > > is common, ref pathconf _PC_MIN_HOLE_SIZE). > > There's no _PC_MIN_HOLE_SIZE in Linux or POSIX. In Windows, a sparse > > file uses chunks of 64K. You can see this even with a file of just > > a single block. Try this: > > > > $ touch x > > $ chattr +S x > > > > $ echo 1234567890123456789012345678901234567890123456789012345678901234567890123456789 >> x > > $ ls -ls x > > 1 -rw-r--r-- 1 corinna vinschen 80 Dec 1 11:56 x > > > > [repeat echo and ls -ls until...] > > > > $ echo 1234567890123456789012345678901234567890123456789012345678901234567890123456789 >> x > > $ ls -ls x > > 1 -rw-r--r-- 1 corinna vinschen 720 Dec 1 11:56 x > > $ echo 1234567890123456789012345678901234567890123456789012345678901234567890123456789 >> x > > $ ls -ls x > > 64 -rw-r--r-- 1 corinna vinschen 800 Dec 1 11:56 x2 > > ^^ > > This > For me, it goes up from 1 to 4, then in steps of 4KB. Is that a local NTFS, did you actually call chattr +S x after touching the file, and did you check with lsattr x that x is actually sparse? 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