All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] license: Improve disk usage
Date: Mon, 15 Sep 2014 15:12:13 +0100	[thread overview]
Message-ID: <1410790333.14624.45.camel@ted> (raw)
In-Reply-To: <5416F0A0.80000@topic.nl>

On Mon, 2014-09-15 at 15:58 +0200, Mike Looijmans wrote:
> I can probably come up with scenarios where "os.stat(src).st_dev == 
> os.stat(destdir).st_dev" but os.link will still fail.
> 
> Less code and does not assume that when src and destdir are on the same 
> device, they can be linked:
> 
> try:
>    os.link(src, dst)
> except:
>    shutil.copyfile(src, dst)

I agree that is probably easier. I'm curious which scenarios you're
thinking of though. We do have that device comparison elsewhere in the
codebase and I copied it mainly as it was how it was done elsewhere...

Cheers,

Richard



  reply	other threads:[~2014-09-15 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 15:39 [PATCH] license: Improve disk usage Richard Purdie
2014-09-15 13:58 ` Mike Looijmans
2014-09-15 14:12   ` Richard Purdie [this message]
2014-09-15 14:47     ` Mike Looijmans
2014-09-15 15:03       ` Burton, Ross

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=1410790333.14624.45.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mike.looijmans@topic.nl \
    --cc=openembedded-core@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.