Web lists-archives.com

Re: Measuring (or calculating) how many bytes are actually written to disk when I repeatedly save a file




Again, thanks to all who replied, some comments below.

On Saturday, April 06, 2019 05:44:19 PM Stefan Monnier wrote:
> > 2. A lot of my editing involves editing near (but not at) the end of
> > a file.  I assume (I know) that the software that saves the file is
> > smart enough not to rewrite the entire file but instead to preserve
> > the beginning of the file and just rewrite the changed part of the
> > file (or from there to the end of the file).
> 
> Not completely sure if "you assume" or "you know" it to be the case.

Sorry, I should have tried to be more clear -- sort of a digression, but I 
came from an environment where anytime someone used the word assume, someone 
else would point out what (they thought) that meant (it makes an ass out of 
[yo]u and me).

I still use the word, but use the "(I know)" as a defensive mechanism to stave 
off the expected response.
> 
> Especially given that you then add:
> > Can anyone confirm that,
> 
> which suggest you're not really sure (unless it referred to something
> else).

To (try to) be clear, I am not sure whether only the changed part (or from the 
changed part of the file to the end is written).  I can imagine that is 
reasonably possible -- I mean, the file is stored in blocks on the disk, and 
some of those blocks are not changed, so why rewrite them.  OTOH, something 
has to be smart enough (be programmed well enough) to recognize that and avoid 
the writes.