delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/12/05/10:15:30

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F383F386186D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1701789330;
bh=lV9WRvPK8ej57Za0T+ee/ucRpp6HRSd2Ktb1OOQsNTc=;
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=OW2PHMjJDFw29+CMdLTZTRrM+eNlgkOv9GbautV6KK1VNO45HrKHsZfTS+4Ix0kGG
slZ9CqO2JAeqPpGkZGy/3/qwXtn9Pa0NOO5PoMC+kVBnYRzbOJe7+CZekGQjIbW8ya
spVt4Ami/WmhuVK84e32+o7iDiQjjKzZNbYsnE1o=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 096773857C42
Date: Tue, 5 Dec 2023 16:15:14 +0100
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin api to punch a hole into a file?
Message-ID: <ZW8-gioc3j9qTYu_@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CALXu0Uee2CHeCpthOKFmct+6HnEsKHbSzdK3Jyx8GsnYyt7Lbw AT mail DOT gmail DOT com>
<ZWCCfqny4lC11bBJ AT calimero DOT vinschen DOT de>
<ZWXBH_viPFuSF6be AT calimero DOT vinschen DOT de>
<CALXu0UcLK5AvrYDOg-9L2wFVhvjJuJre6X6GvL+5SyL744eygA AT mail DOT gmail DOT com>
<ZWm9NNUlxdOunBGP AT calimero DOT vinschen DOT de>
<33d4b0df-7a6a-40cf-85a2-9a4300198672 AT towo DOT net>
<ZW8rPaJ5jua08WHH AT calimero DOT vinschen DOT de>
<12e1d9d9-bc56-456e-a1ab-c760987f3ac2 AT towo DOT net>
<06bd1d13-7d60-4e45-b597-70816a2ad559 AT towo DOT net>
MIME-Version: 1.0
In-Reply-To: <06bd1d13-7d60-4e45-b597-70816a2ad559@towo.net>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3B5FFUnG010164

On Dec  5 15:47, Thomas Wolff via Cygwin wrote:
> 
> Am 05/12/2023 um 15:40 schrieb Thomas Wolff via Cygwin:
> > Am 05/12/2023 um 14:53 schrieb Corinna Vinschen via 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?
> > Ups, sorry, I was just throwing my 2p into something. Yes, on a local
> > NTFS; setting chattr +s does not change it but lsattr says:
> > ---a-------- .ls-s
> > 
> > So why does chattr not seem to work?
> Sorry again, I failed to test properly (I had copied your `chattr +S x`
> which is not the filename I tested... blush).
> With chattr +S, I reproduce your observation.

No worries. Thanks for testing and confirming!


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019