利用 os.stat 判断文件是否损

os模块提供了一种跨平台的方式来使用操作系统特定的功能。os.stat()函数返回关于指定路径的统计信息,帮助判断文件是否损坏。虽然这个功能在大多数操作系统上可用,但过度依赖特定系统的扩展可能会影响程序的移植性。在遇到如无效或不可访问的文件名和路径等问题时,os模块的函数会抛出OSError。
摘要由CSDN通过智能技术生成


This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, see the os.path module, and if you want to read all the lines in all the files on the command line see the fileinpu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值