#19211 [NEW]: fputs and fwrite problems

From: Date: Tue, 03 Sep 2002 16:54:18 +0000
Subject: #19211 [NEW]: fputs and fwrite problems
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18310@lists.php.net to get a copy of this message
From: dw59@earthlink.net Operating system: Cobalt Linux (Redhat) PHP version: 4CVS-2002-09-03 PHP Bug Type: Filesystem function related Bug description: fputs and fwrite problems 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 bug report at http://bugs.php.net/?id=19211&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19211&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19211&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19211&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19211&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19211&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19211&r=support Expected behavior: http://bugs.php.net/fix.php?id=19211&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19211&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19211&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19211&r=globals

« previous php.bugs (#18310) next »