note 14603 added to function.file-exists.php

From: Date: Mon, 06 Aug 2001 07:50:12 +0000
Subject: note 14603 added to function.file-exists.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16364@lists.php.net to get a copy of this message
Am I an idiot? <html> <body> <? $bIsFileOne = is_file("/tmp/test.txt"); # Will be true cause test.txt will exist sleep (5); # Sleep while you telnet in and remove test.txt quickly! $sTemp = /bin/rm -R /tmp/test.txt; # Or just remove it automatically sleep (5); # Sleep just to be safe $bIsFileTwo = file_exists("/tmp/test.txt"); $bIsFileThree = is_file("/tmp/test.txt"); ?> <br> File1:<? echo $bIsFileOne; ?> File2:<? echo $bIsFileTwo; ?> File3:<? echo $bIsFileThree; ?> File 2 and 3 should show false or 0 cause the file is gone, but they say 1 just like bIsFileOne! </body> </html> Linux 2.2.18 PHP 4.0.6 http://www.php.net/manual/en/function.file-exists.php

« previous php.notes (#16364) next »