public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin api to punch a hole into a file?
Date: Tue, 5 Dec 2023 16:15:14 +0100	[thread overview]
Message-ID: <ZW8-gioc3j9qTYu_@calimero.vinschen.de> (raw)
In-Reply-To: <06bd1d13-7d60-4e45-b597-70816a2ad559@towo.net>

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

  reply	other threads:[~2023-12-05 15:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 22:36 Cedric Blancher
2023-11-24 11:01 ` Corinna Vinschen
2023-11-28 10:29   ` Corinna Vinschen
2023-12-01 10:22     ` Cedric Blancher
2023-12-01 11:02       ` Corinna Vinschen
2023-12-04 16:07         ` Andrey Repin
2023-12-05  6:36         ` Thomas Wolff
2023-12-05 13:53           ` Corinna Vinschen
2023-12-05 14:40             ` Thomas Wolff
2023-12-05 14:47               ` Thomas Wolff
2023-12-05 15:15                 ` Corinna Vinschen [this message]
2023-12-01 10:44     ` _PC_MIN_HOLE_SIZE pathconf() " Cedric Blancher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZW8-gioc3j9qTYu_@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).