# HG changeset patch # User Thomas Preud'homme # Date 1307208537 -7200 # Node ID b54e5a4102da5b8ed0c0a2acc6639657452b3736 # Parent 8cd8cd9da541c9623fcb0175f3a38f3fc5c66f28 os.stat precision fix diff -r 8cd8cd9da541 -r b54e5a4102da gcp --- a/gcp Tue Jan 25 16:59:56 2011 +0100 +++ b/gcp Sat Jun 04 19:28:57 2011 +0200 @@ -3,7 +3,8 @@ """ gcp: Goffi's CoPier -Copyright (C) 2010, 2011 Jérôme Poisson (goffi@goffi.org) +Copyright (C) 2010, 2011 Jérôme Poisson + (c) 2011 Thomas Preud'homme This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -410,15 +411,15 @@ def __post_copy(self, source_file, dest_file, options): """Do post copy traitement (mainly managing --preserve option)""" - st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime = os.stat(source_file) + st_file = os.stat(source_file) for preserve in options.preserve: try: if preserve == 'mode': - os.chmod(dest_file, st_mode) + os.chmod(dest_file, st_file.st_mode) elif preserve == 'ownership': - os.chown(dest_file, st_uid, st_gid) + os.chown(dest_file, st_file.st_uid, st_file.st_gid) elif preserve == 'timestamps': - os.utime(dest_file, (st_atime, st_mtime)) + os.utime(dest_file, (st_file.st_atime, st_file.st_mtime)) except OSError,e: self.journal.error("preserve-"+preserve)