note 36209 deleted from function.file-exists by sniper

From: Date: Sun, 23 Nov 2003 01:26:59 +0000
Subject: note 36209 deleted from function.file-exists by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-60833@lists.php.net to get a copy of this message
Note Submitter: f97system@yahoo.com, Dimce Grozdanoski ---- My working Windows directory is c:\Program Files\Apache Group\Apache2\htdocs, I have some scripts /app/mr/main.php where I use function file_exists(). When I need to check existens of some file in /app/mr/ or some subdirectory of /app/mr/ then file_exists() work well, but if I need to check existens in some other directory, for example in my case, to check existence of /app/art/CheckedFile.jpg then this code dosn't work $filename = "/app/art/CheckedFile.jpg"; if (file_exists($filename)) {echo $filename." exists";} else {echo $filename." not exists";} but this work well $winDir = "c:/Program Files/Apache Group/Apache2/htdocs"; $filename = "/app/art/CheckedFile.jpg"; if (file_exists($winDir.$filename)) {echo $filename." exists";} else {echo $filename." not exists";} if you specify relative path for checked file then file_exists() works well only if checked file is at same directory or subdirectory of calling script directory, otherwise you should specify absolute path for checked file.

« previous php.notes (#60833) next »