我正在尝试使用 python 获取名为
fGDB.gdb
的文件的大小。但是虽然 Windows 属性将文件大小显示为 146 KB (150,399 bytes)
使用此代码
import os
gdb = r"C:\Users\...\....\fGDB.gdb"
file_size = os.path.getsize(gdb)
print("File Size is :", file_size, "bytes")
返回此:
File Size is : 12288 bytes
有人可以告诉我为什么大小不同以及如何通过 Python 获得显示在操作系统属性窗口上的确切数字吗?
您可以提取已缓存的文件吗?