#22858 [Fbk->NoF]: file function fails to open relative file names...
| From: | sniper@php.net | Date: | Mon, 31 Mar 2003 08:00:17 +0000 |
| Subject: | #22858 [Fbk->NoF]: file function fails to open relative file names... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36775@lists.php.net to get a copy of this message | ||
ID: 22858
Updated by: sniper@php.net
Reported By: excalibur at hub dot org
-Status: Feedback
+Status: No Feedback
Bug Type: Filesystem function related
Operating System: FreeBSD 4.8-RC
PHP Version: 4.3.1
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2003-03-24 17:37:06] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-03-24 14:38:34] excalibur at hub dot org
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22858&edit=1