[email protected]:~$ ls -al /home/debian8/.mozilla/firefox/3usaclqf.default/lock
lrwxrwxrwx 1 debian8 debian8 15 Jun 19 18:58 /home/debian8/.mozilla/firefox/3usaclqf.default/lock -> 127.0.1.1:+2815
文件/home/debian8/.mozilla/firefox/3usaclqf.default/lock
是一個鏈接。爲什麼FileNotFoundError:[錯誤2]沒有這樣的文件或目錄?
[email protected]:~$ python
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58)
>>> import os
>>> file1="/tmp/.X0-lock"
>>> print(os.stat(file1))
os.stat_result(st_mode=33060, st_ino=8126472, st_dev=2050, st_nlink=1, st_uid=0, st_gid=0, st_size=11, st_atime=1497877067, st_mtime=1497868886, st_ctime=1497868886)
>>> file2="/home/debian8/.mozilla/firefox/3usaclqf.default/lock"
>>> print(os.stat(file2))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/home/debian8/.mozilla/firefox/3usaclqf.default/lock'
爲什麼os.stat
無法獲取file2上的信息?
它已經在777個狀態。 –