osfs.py 文件源码

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

项目:pyfilesystem2 作者: PyFilesystem 项目源码 文件源码
def _make_details_from_stat(cls, stat_result):
        """Make a *details* info dict from an `os.stat_result` object.
        """
        details = {
            '_write': ['accessed', 'modified'],
            'accessed': stat_result.st_atime,
            'modified': stat_result.st_mtime,
            'size': stat_result.st_size,
            'type': int(cls._get_type_from_stat(stat_result))
        }
        # On other Unix systems (such as FreeBSD), the following
        # attributes may be available (but may be only filled out if
        # root tries to use them):
        details['created'] = getattr(stat_result, 'st_birthtime', None)
        ctime_key = (
            'created'
            if _WINDOWS_PLATFORM
            else 'metadata_changed'
        )
        details[ctime_key] = stat_result.st_ctime
        return details
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号