SFTP: get 'ctime' attribute from 'tahoe:linkmotime'.

This commit is contained in:
david-sarah 2010-06-16 20:37:44 -07:00
parent 9f5488b2d1
commit c1412c8a81
1 changed files with 2 additions and 5 deletions

View File

@ -241,16 +241,13 @@ def _populate_attrs(childnode, metadata, size=None):
# We would prefer to omit atime, but SFTP version 3 can only # We would prefer to omit atime, but SFTP version 3 can only
# accept mtime if atime is also set. # accept mtime if atime is also set.
if 'linkmotime' in metadata.get('tahoe', {}): if 'linkmotime' in metadata.get('tahoe', {}):
attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['tahoe']['linkmotime']) attrs['ctime'] = attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['tahoe']['linkmotime'])
elif 'mtime' in metadata: elif 'mtime' in metadata:
attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['mtime']) attrs['ctime'] = attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['mtime'])
if 'linkcrtime' in metadata.get('tahoe', {}): if 'linkcrtime' in metadata.get('tahoe', {}):
attrs['createtime'] = _to_sftp_time(metadata['tahoe']['linkcrtime']) attrs['createtime'] = _to_sftp_time(metadata['tahoe']['linkcrtime'])
if 'ctime' in metadata:
attrs['ctime'] = _to_sftp_time(metadata['ctime'])
attrs['permissions'] = perms attrs['permissions'] = perms
# twisted.conch.ssh.filetransfer only implements SFTP version 3, # twisted.conch.ssh.filetransfer only implements SFTP version 3,