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 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core