Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #48453
| From | Roy Smith <roy@panix.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Version Control Software |
| Date | 2013-06-16 09:50 -0400 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <roy-47D4D9.09501916062013@news.panix.com> (permalink) |
| References | (6 earlier) <CAN8CLg=sN8oF6hxPNojF1nyfhw8HXAXr-unsy_wX_=ks6BvaGA@mail.gmail.com> <mailman.3359.1371275633.3114.python-list@python.org> <roy-DB7870.10161515062013@news.panix.com> <CAPTjJmreNJ0acuG=GAr186pMST7h5G6_Y1osz=Pj2L=DC6RyFw@mail.gmail.com> <mailman.3442.1371389433.3114.python-list@python.org> |
In article <mailman.3442.1371389433.3114.python-list@python.org>,
Chris メKwpolskaモ Warrick <kwpolska@gmail.com> wrote:
> (I’m using wc -c to count the bytes in all files there are. du is
> unaccurate with files smaller than 4096 bytes.)
It's not that du is not accurate, it's that it's measuring something
different. It's measuring how much disk space the file is using. For
most files, that's the number of characters in the file rounded up to a
full block. For large files, I believe it also includes the overhead of
indirect blocks or extent trees. And, finally, for sparse files, it
takes into account that some logical blocks in the file may not be
mapped to any physical storage.
So, whether you want to use "du" or "wc -c" depends on what you're
trying to measure. If you want to know how much disk space you're
using, du is the right tool. If you want to know how much data will be
transmitted if the file is serialized (i.e. packed in a tarball or sent
via a "{hg,git} clone" operation), then "wc-c" is what you want.
All that being said, for the vast majority of cases (and I would be
astonished if this was not true for any real-life vcs repo), the
difference between what wc and du tell you is not worth worrying about.
And du is going to be a heck of a lot faster.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Version Control Software cutems93 <ms2597@cornell.edu> - 2013-06-12 16:27 -0700
Re: Version Control Software Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 16:36 -0700
Re: Version Control Software Joel Goldstick <joel.goldstick@gmail.com> - 2013-06-12 19:52 -0400
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:04 +1000
Re: Version Control Software Tim Chase <python.list@tim.thechases.com> - 2013-06-12 21:41 -0500
Re: Version Control Software Ben Finney <ben+python@benfinney.id.au> - 2013-06-13 12:30 +1000
Re: Version Control Software rusi <rustompmody@gmail.com> - 2013-06-13 04:54 -0700
Re: Version Control Software Grant Edwards <invalid@invalid.invalid> - 2013-06-13 17:06 +0000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-14 07:26 +1000
Re: Version Control Software Grant Edwards <invalid@invalid.invalid> - 2013-06-13 21:53 +0000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-14 07:59 +1000
Re: Version Control Software Zero Piraeus <schesis@gmail.com> - 2013-06-13 18:20 -0400
Re: Version Control Software Terry Reedy <tjreedy@udel.edu> - 2013-06-13 20:09 -0400
Re: Version Control Software Fábio Santos <fabiosantosart@gmail.com> - 2013-06-13 23:15 +0100
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-14 08:17 +1000
Re: Version Control Software Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-06-13 15:24 -0700
Re: Version Control Software Neil Hodgson <nhodgson@iinet.net.au> - 2013-06-14 08:53 +1000
Re: Version Control Software Tim Chase <python.list@tim.thechases.com> - 2013-06-12 21:48 -0500
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-12 22:51 -0400
Re: Version Control Software Rui Maciel <rui.maciel@gmail.com> - 2013-06-13 13:43 +0100
Re: Version Control Software cutems93 <ms2597@cornell.edu> - 2013-06-12 23:00 -0700
Re: Version Control Software rusi <rustompmody@gmail.com> - 2013-06-12 23:43 -0700
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-13 07:08 -0400
Re: Version Control Software MRAB <python@mrabarnett.plus.com> - 2013-06-13 12:26 +0100
Re: Version Control Software rusi <rustompmody@gmail.com> - 2013-06-13 04:46 -0700
Re: Version Control Software Anssi Saari <as@sci.fi> - 2013-06-14 15:06 +0300
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-14 08:32 -0400
Re: Version Control Software Grant Edwards <invalid@invalid.invalid> - 2013-06-14 14:24 +0000
Re: Version Control Software Dave Angel <davea@davea.name> - 2013-06-14 16:55 -0400
Re: Version Control Software Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-14 20:26 -0400
Re: Version Control Software Tim Delaney <timothy.c.delaney@gmail.com> - 2013-06-15 15:39 +1000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-15 15:53 +1000
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-15 10:16 -0400
Re: Version Control Software Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2013-06-15 15:29 +0000
Re: Version Control Software Dan Sommers <dan@tombstonezero.net> - 2013-06-15 18:29 +0000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-16 09:01 +1000
Re: Version Control Software Tim Delaney <timothy.c.delaney@gmail.com> - 2013-06-16 07:49 +1000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-16 09:14 +1000
Re: Version Control Software rusi <rustompmody@gmail.com> - 2013-06-15 20:55 -0700
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-16 14:13 +1000
Re: Version Control Software Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-16 05:20 +0000
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-16 15:29 +1000
Re: Version Control Software Terry Reedy <tjreedy@udel.edu> - 2013-06-16 05:15 -0400
Re: Version Control Software Chris Angelico <rosuav@gmail.com> - 2013-06-16 19:51 +1000
Re: Version Control Software Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-16 15:30 +0200
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-16 09:50 -0400
Re: Version Control Software Lele Gaifax <lele@metapensiero.it> - 2013-06-16 17:48 +0200
Re: Version Control Software Terry Reedy <tjreedy@udel.edu> - 2013-06-16 13:02 -0400
Re: Version Control Software Jason Swails <jason.swails@gmail.com> - 2013-06-16 12:39 -0400
Re: Version Control Software Serhiy Storchaka <storchaka@gmail.com> - 2013-06-13 10:20 +0300
Re: Version Control Software Tim Chase <python.list@tim.thechases.com> - 2013-06-13 07:34 -0500
Re: Version Control Software Roy Smith <roy@panix.com> - 2013-06-13 08:52 -0400
csiph-web