|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-24 17:37 UTC] iliaa@php.net
[2003-03-31 02:00 UTC] sniper@php.net
[2003-03-31 09:24 UTC] excalibur at hub dot org
[2003-03-31 18:13 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 15:00:02 2025 UTC |
Hi Guy's, Got an issue that appears to be related to some other functions but as this one is specific to a function I figured it's due it's own bug posting. Ran into an issue where file() does not open relative file names, for instance: $words_file = "./config/filter.txt"; if (@is_readable($words_file)) { /* Read the file and iterate through the lines. */ $lines = file($words_file); foreach ($lines as $line) { print $line."<BR>"; } } I get: Warning: file(./config/filter.txt) [function.file]: failed to create stream: No such file or directory in /usr/local/www/test.com/horde/lib/Text.php on line 41 Warning: Invalid argument supplied for foreach() in /usr/local/www/test.com/horde/lib/Text.php on line 42 Yet if I specify the full path to the very same file, it works fine: $words_file = "/usr/local/www/test.com/horde/imp/config/filter.txt"; if (@is_readable($words_file)) { /* Read the file and iterate through the lines. */ $lines = file($words_file); foreach ($lines as $line) { print $line."<BR>"; } } The is_readable sees the file fine, but file itself fails.