首页 > Python资料 博客日记
Python os.stat()方法
2023-08-06 14:33:37Python资料围观239次
文章Python os.stat()方法分享给大家,欢迎收藏Python资料网,专注分享技术知识
Python的stat()
方法在给定路径上执行统计系统调用。
语法
以下是stat()
方法的语法 -
os.rmdir(path)
参数
- path - 这是要统计信息是必需的路径。
返回值
以下是stat
结构的成员列表:
st_mode
- 保护位。st_ino
- inode编号。st_dev
- 设备。st_nlink
- 硬链接数。st_uid
- 所有者的用户ID。st_gid
- 所有者的组ID。st_size
- 文件大小(以字节为单位)。st_atime
- 最近访问的时间。st_mtime
- 最近修改内容的时间。st_ctime
- 最近元数据更改的时间。
示例
以下示例显示了stat()
方法的用法。
# !/usr/bin/python3
import os, sys
# showing stat information of file "foo.txt"
statinfo = os.stat('foo.txt')
print (statinfo)
当运行上述程序时,它会产生以下结果 -
os.stat_result(st_mode = 33206, st_ino = 281474976797706,
st_dev = 1017554828, st_nlink = 1, st_uid = 0, st_gid = 0,
st_size = 13, st_atime = 1455649253, st_mtime = 1438077266, st_ctime = 1455560006)
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!
标签:
上一篇:Python os.mknod()方法
下一篇:Python热图
相关文章
最新发布
- M3U8工作原理以及key解密视频流详解
- 使用 Grype 检查 .jar 包中的漏洞
- 等保测评中的数据安全风险评估:企业实战
- 15:00面试,15:08就出来了,问的问题有点变态。。。
- 数据赋能(202)——开发:数据开发管理——技术方法、主要工具
- 【Python】字典
- 华为OD机试真题最新题库 (B+C+D+E卷) + 在线OJ在线刷题使用说明(C++、Java、Python合集)(目前已收录540道)
- python 下载并离线安装第三方库
- 【安装tensorflow报错已解决】LibMambaUnsatisfiableError: Encountered problems while solving:
- 基于funasr+pyaudio实现电脑本地麦克风实时语音识别项目语音转文本python实现
点击排行
- 版本匹配指南:Numpy版本和Python版本的对应关系
- Python 可视化 web 神器:streamlit、Gradio、dash、nicegui;低代码 Python Web 框架:PyWebIO
- 版本匹配指南:PyTorch版本、torchvision 版本和Python版本的对应关系
- 相关性分析——Pearson相关系数+热力图(附data和Python完整代码)
- Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based proj
- Python pyinstaller打包exe最完整教程
- Anaconda版本和Python版本对应关系(持续更新...)
- Python与PyTorch的版本对应