python ctime源码_Python stat.ST_CTIME属性代码示例

本文详细介绍了Python stat模块中的ST_CTIME属性,通过8个真实代码示例展示其用法,适用于理解如何获取文件的创建时间戳,并将其转换为日期格式。示例涵盖多种使用场景,包括数据库连接、文件元数据处理等。
摘要由CSDN通过智能技术生成

本文整理汇总了Python中stat.ST_CTIME属性的典型用法代码示例。如果您正苦于以下问题:Python stat.ST_CTIME属性的具体用法?Python stat.ST_CTIME怎么用?Python stat.ST_CTIME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在模块stat的用法示例。

在下文中一共展示了stat.ST_CTIME属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: fetch

​点赞 6

# 需要导入模块: import stat [as 别名]

# 或者: from stat import ST_CTIME [as 别名]

def fetch(self, is_dl_forced=False):

'''connection details for DISCO'''

cxn = {}

cxn['host'] = 'nif-db.crbs.ucsd.edu'

cxn['database'] = 'disco_crawler'

cxn['port'] = '5432'

cxn['user'] = config.get_config()['user']['disco']

cxn['password'] = config.get_config()['keys'][cxn['user']]

pg_iri = 'jdbc:postgresql://'+cxn['host']+':'+cxn['port']+'/'+cxn['database']

self.dataset.set_ingest_source(pg_iri)

# process the tables

# self.fetch_from_pgdb(self.tables,cxn,100) #for testing

self.fetch_from_pgdb(self.tables, cxn)

self.get_files(is_dl_forced)

fstat = os.stat('/'.join((self.rawdir, 'dvp.pr_nlx_157874_1')))

filedate = datetime.utcfromtimestamp(fstat[ST_CTIME]).strftime("%Y-%m-%d")

self.dataset.set_ingest_source_file_version_date(pg_iri, filedate)

开发者ID:monarch-initiative,项目名称:dipper,代码行数:24,

示例2: test_version_level_source_version_download_timestamp

​点赞 6

# 需要导入模块: import stat [as 别名]

# 或者: from stat import ST_CTIME [as 别名]

def test_version_level_source_version_download_timestamp(self):

path_to_dl_file = '/'.join(

(self.source.rawdir, self.source.files.get('test

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值