is_executable() tells you whether you can run a file
<? if ( is_executable( "test.txt" ) { print "test.txt is executable"; } ?>