Forum Moderators: coopster

Message Too Old, No Replies

Lookinf or file_exists() Alternative

because I don't get the absolute path

         

waldemar

1:10 pm on Oct 13, 2003 (gmt 0)

10+ Year Member



Well it looks like file_exists() only works with absolute paths which I don't get in our environment.

- Don't want to use file() since I believe it to be too slow for 600 file checks
- Strangly with is_file I only receive true values

Does anybody know of an alternative function that would be as fast?

gethan

1:51 pm on Oct 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you not get the $DOCUMENT_ROOT global variable?

file_exists($DOCUMENT_ROOT . "example.html");

Maybe someone know of something else though...

coopster

1:56 pm on Oct 13, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



See if the realpath [us3.php.net] function will work for you.

waldemar

2:08 pm on Oct 13, 2003 (gmt 0)

10+ Year Member



Thanks guys! I also tried filesize() which provides some additional interesting information :-) (and it seems to work).