#19211 [Opn->Csd]: fputs and fwrite problems
| From: | derick@php.net | Date: | Tue, 03 Sep 2002 17:20:32 +0000 |
| Subject: | #19211 [Opn->Csd]: fputs and fwrite problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18313@lists.php.net to get a copy of this message | ||
ID: 19211
Updated by: derick@php.net
Reported By: dw59@earthlink.net
-Status: Open
+Status: Closed
Bug Type: Filesystem function related
Operating System: Cobalt Linux (Redhat)
PHP Version: 4CVS-2002-09-03
New Comment:
Should be fixed, try RC2 from www.php.net/~zeev/php-4.2.3RC2.tar.gz
Please reopen if it's not fixed (And a filepointer is indeed a
resource, so that's OK).
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-09-03 12:54:17] dw59@earthlink.net
This only recently began when I switched to a snapshot version
4.2.3-dev from 4.2.2 for an unrelated problem.
//open, write to and close file
$fp = fopen($html_xml_index_file, "w+");
if (!$fp) exit ("Could not open " . $html_xml_index_file . " for
writing!");
$result = fputs($fp, $xml_data, strlen($xml_data));
echo "bytes written - " . $result . "<br/>" .
"totol data length - " . strlen($xml_data) . "<br/>" .
"file handle - " . $fp;
fclose($fp); exit;
Produces:
bytes written - 0
totol data length - 447356
file handle - Resource id #4
No data written...No errors produced. Using either 'fputs' or 'fwrite'
with or without the optional 'length' argument.
What is "Resource id #4"? I thought a file pointer would be returned
as an integer value?
Thanks,
DWilliams
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19211&edit=1