strace -tt -f -e '$file="filename";-e($file) && -f($file)'
(as well as the alternative) says it's exactly one stat system call more expensive, unsurprisingly. Which on the system I tested it on was something like 0.0001 seconds but that will obviously vary.
| [reply] [d/l] |
Four characters. Six, if you also rip out the parentheses. :-)
Seriously, it's not just about saving one system call or half a dozen source code chars (altough I am all in favour of both) -- -d $filename && -x _ && -k _ && -u _ is simpler, cleaner, and more expressive than the alternative IMHO.
BTW, I happen to like even more the perl6ish $filename ~~ :d & :x & :k & :u.
[]s, HTH, Massa (κς,πμ,πλ)
| [reply] [d/l] [select] |
-d -x -u $filename
| [reply] [d/l] |