Bug #12004: problem with fopen over ftp and a related fgets
| From: | koenig at internet24 dot de | Date: | Tue, 10 Jul 2001 10:07:36 +0000 |
| Subject: | Bug #12004: problem with fopen over ftp and a related fgets | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-59517@lists.php.net to get a copy of this message | ||
From: koenig@internet24.de
Operating system: linux
PHP version: 4.0.5
PHP Bug Type: *Directory/Filesystem functions
Bug description: problem with fopen over ftp and a related fgets
Configure './configure'
'--with-apxs=/usr/local/apache/bin/apxs'
Command '--with-mysql' '--with-pgsql' '--with-zlib'
'--enable-ftp'
'--with-gd'
'--with-jpeg-dir=/usr/local/lib'
'--enable-versioning'
'--enable-track-vars=yes'
'--enable-url-includes'
'--enable-sysvshm'
'--enable-syscsem' '--with-gettext'
<?php
$file = "user:secret@somewhere.org/path/file.txt";
if (!($fp = fopen($file, "r+"))) {
echo "error: can't open file<br>";
exit;
}
fputs($fp, "test number one...");
fputs($fp, "test number two...");
fputs($fp, "etc...");
fclose($fp);
?>
-------------------------------
The problem is, that nothing is written in the file even though fopen,fputs
and
fclose do not return an error.
If you use fopen($file, "a+") the strings are written to file. But now
the problem is, that fopen tries to create that file even if it already
exists.
Ciao,
Tobias
--
Edit bug report at: http://bugs.php.net/?id=12004&edit=1