It really is quite silly...
Say you have a file "c:\somedir\global.txt"...
$isfile(c:\somedir\global.txt)
returns
$false
But you can still find the file using $findfile, so...
alias fileExists {
if ($findfile($nofile($1-),$nopath($1-),0,1) == 1) { return $true }
else { return $false }
}
$fileExists(c:\somedir\global.txt)
returns
$true
So obviously if it was intended as a security feature, it's one that is rather easy to bypass.
For the curious as to how much slower that function is, here's some results for 10,000 calls..
On an existing file:
$isfile: 2.263s
$fileExists: 1.502s
On an existing 'reserved' file
$isfile: 1.052s
$fileExists: 1.522s
On a non-existing file:
$isfile: 2.413s
$fileExists: 1.382s
Funny, no? It's faster in all but 1 case - and in that case, $isfile returns bogus data anyway so who cares how fast it is %) If needed in a loop over dirs, $nofile can be precalced, and it's even faster. Silly.