📜  检查文件的可访问性 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:44.681000             🧑  作者: Mango

代码示例1
print(os.access('sample.txt', os.R_OK))
# Output False
f = open("sample.txt", "x") #create the file
#check again
print(os.access('sample.txt', os.R_OK))
# Output True