755 |
def settime(self, accesstime, modtime): |
def settime(self, accesstime, modtime): |
756 |
"""Change file modification times""" |
"""Change file modification times""" |
757 |
log.Log("Setting time of %s to %d" % (self.path, modtime), 7) |
log.Log("Setting time of %s to %d" % (self.path, modtime), 7) |
758 |
self.conn.os.utime(self.path, (accesstime, modtime)) |
try: self.conn.os.utime(self.path, (accesstime, modtime)) |
759 |
self.data['atime'] = accesstime |
except OverflowError: |
760 |
self.data['mtime'] = modtime |
log.Log("Cannot change times of %s to %s - problem is probably" |
761 |
|
"64->32bit conversion" % |
762 |
|
(self.path, (accesstime, modtime)), 2) |
763 |
|
else: |
764 |
|
self.data['atime'] = accesstime |
765 |
|
self.data['mtime'] = modtime |
766 |
|
|
767 |
def setmtime(self, modtime): |
def setmtime(self, modtime): |
768 |
"""Set only modtime (access time to present)""" |
"""Set only modtime (access time to present)""" |
769 |
log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) |
log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) |
770 |
self.conn.os.utime(self.path, (long(time.time()), modtime)) |
try: self.conn.os.utime(self.path, (long(time.time()), modtime)) |
771 |
self.data['mtime'] = modtime |
except OverflowError: |
772 |
|
log.Log("Cannot change mtime of %s to %s - problem is probably" |
773 |
|
"64->32bit conversion" % (self.path, modtime), 2) |
774 |
|
else: self.data['mtime'] = modtime |
775 |
|
|
776 |
def chown(self, uid, gid): |
def chown(self, uid, gid): |
777 |
"""Set file's uid and gid""" |
"""Set file's uid and gid""" |