2012-02-16 71 views

回答

11

-f運算符測試其操作數是否是常規文件,而不是目錄,符號鏈接或其他特殊文件。

所有以-開頭的運算符都稱爲文件測試運算符,並且通常也以shell腳本語言存在。它們是一元運算符(只需一個操作數),如!~是一元運算符。

+2

[有關文件操作符的詳細信息,請參見這裏。](http://perldoc.perl.org/functions/-X.html) – Feysal 2012-02-16 08:48:21

8
-r readable 
-w writable 
-x executable 
-o owned by user 
-R readable by this user or group 
-W writable by user or group 
-X executable by this user or group 
-O owned by this user 
-e File or directory name exists 
-z File exists and has zero size 
-s exists and has nonzero size (the value is the size in bytes) 
-f plain file 
-d directory 
-l symbolic link 
-S socket 
+0

非常感謝... – 2012-02-16 09:01:48