Browse code

if getting to stdout pipe, destination is a dummy string and not a file--don't try to set modified time

Space authored on 2014/03/18 10:11:00
Showing 1 changed files
... ...
@@ -508,7 +508,7 @@ def cmd_object_get(args):
508 508
         if response["headers"].has_key("x-amz-meta-s3tools-gpgenc"):
509 509
             gpg_decrypt(destination, response["headers"]["x-amz-meta-s3tools-gpgenc"])
510 510
             response["size"] = os.stat(destination)[6]
511
-        if response["headers"].has_key("last-modified"):
511
+        if response["headers"].has_key("last-modified") and destination != "-":
512 512
             last_modified = time.mktime(time.strptime(response["headers"]["last-modified"], "%a, %d %b %Y %H:%M:%S GMT"))
513 513
             os.utime(destination, (last_modified, last_modified))
514 514
             debug("set mtime to %s" % last_modified)