dump.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:mygene.info 作者: biothings 项目源码 文件源码
def get_ftpfile_lastmodified(self, file_path):
        '''return lastmodified for a given file on ftp server.'''
        try:
            response = self.client.sendcmd('MDTM ' + file_path)
        except error_perm as e:
            self.logger.debug("Skip %s: %s" % (file_path,e))
            return None
        code, lastmodified = response.split()
        # an example: 'last-modified': '20121128150000'
        lastmodified = int(time.mktime(datetime.strptime(lastmodified, '%Y%m%d%H%M%S').timetuple()))
        return lastmodified
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号