[pacman-dev] [PATCH] Replace @SIZECMD@ with POSIX-compatible command

Mike Swanson mikeonthecomputer at gmail.com
Sat Mar 25 00:26:26 UTC 2017


On Mon, 2017-03-20 at 15:19 +1000, Allan McRae wrote:
> On 20/03/17 12:55, Drew DeVault wrote:
> > Now uses wc -c $file | cut -d' ' -f1, which works using only POSIX
> > commands and removes the need for any platform-specific usages.
> > 
> 
> I'm sure we had this in the past and changed to what we have
> currently.
>  Can't remember why...   compressing filesystems maybe?
> 
> A

`wc -c` always shows the true size of a file -- that is, the number of
bytes of information it contains, not a multiple of the block size.  The
compressed size can only be calculated by looking at the number of
blocks allocated.  This command is safe for all compressing/sparse-
supporting file systems.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: This is a digitally signed message part
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20170324/3d2c0c16/attachment.asc>


More information about the pacman-dev mailing list