From: Joshua Lock <joshua.lock@collabora.co.uk>
To: "Burton, Ross" <ross.burton@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] oeqa/selftest/wic: add test case for sparse images
Date: Thu, 17 Dec 2015 16:52:22 +0000 [thread overview]
Message-ID: <5672E846.2080706@collabora.co.uk> (raw)
In-Reply-To: <CAJTo0LbLOLuych6csLX4gEc9ZpboknLiEj9jw6HezmshtCCcLQ@mail.gmail.com>
On 17/12/15 16:21, Burton, Ross wrote:
>
> On 17 December 2015 at 16:09, Joshua Lock <joshua.lock@collabora.co.uk
> <mailto:joshua.lock@collabora.co.uk>> wrote:
>
> + used = int(runCmd("du %s | awk '{print $1}'" % path).output)
> + apparent = int(runCmd("du --apparent-size %s | awk '{print
> $1}'" % path).output)
>
>
> Surely os.stat() can do this instead?
Of course it can — st_blocks is the "number of 512-byte blocks allocated
for file" we can multiply st_blocks by 512 to get the on-disk size
(whilst st_size is the apparent size).
https://docs.python.org/2/library/os.html#os.stat
I'll create a v2.
Joshua
next prev parent reply other threads:[~2015-12-17 16:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 16:33 [PATCH] wic/utils/partitionedfs.py: assemble .wic images as sparse files Joshua Lock
2015-12-17 12:21 ` Ed Bartosh
2015-12-17 13:19 ` Joshua Lock
2015-12-17 13:23 ` Burton, Ross
2015-12-17 13:53 ` Ed Bartosh
2015-12-17 16:09 ` [PATCH] oeqa/selftest/wic: add test case for sparse images Joshua Lock
2015-12-17 16:21 ` Burton, Ross
2015-12-17 16:52 ` Joshua Lock [this message]
2015-12-17 19:43 ` [[PATCH v2] " Joshua Lock
2015-12-30 9:53 ` Ed Bartosh
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=5672E846.2080706@collabora.co.uk \
--to=joshua.lock@collabora.co.uk \
--cc=openembedded-core@lists.openembedded.org \
--cc=ross.burton@intel.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