OS.STAT() - File Statistics
Python
#!/usr/bin/env python3
"""OS.STAT() - File Statistics"""
import os, tempfile
temp = tempfile.gettempdir()
f = os.path.join(temp, "test.txt")
open(f, 'w').write("test")
s = os.stat(f)
print("File Statistics:")
print(f" Size: {s.st_size} bytes")
print(f" Mode: {oct(s.st_mode)}")
print(f" Inode: {s.st_ino}")
print(f" Links: {s.st_nlink}")
print(f" UID: {s.st_uid}")
print(f" GID: {s.st_gid}")
print(f" Accessed: {s.st_atime}")
print(f" Modified: {s.st_mtime}")
print(f" Created: {s.st_ctime}")
os.remove(f)