PHP 4.0 Bug #9282 Updated: printint chr(0x0a) in a file generate 0x0d 0x0a
| From: | hholzgra@php.net | Date: | Thu, 15 Feb 2001 15:48:49 +0000 |
| Subject: | PHP 4.0 Bug #9282 Updated: printint chr(0x0a) in a file generate 0x0d 0x0a | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46666@lists.php.net to get a copy of this message | ||
ID: 9282
Updated by: hholzgra
Reported By: Olivier.Ziller@univ-nancy2.fr
Old-Status: Open
Status: Closed
Bug Type: Unknown/Other Function
Assigned To:
Comments:
this is how windows (aka MS-DOS) works,
to write transparent binary to a file you have to
open it with mode "wb" instead of "w"
(unix will accept the 'b' too although it has no effect there)
Previous Comments:
---------------------------------------------------------------------------
[2001-02-15 10:36:48] Olivier.Ziller@univ-nancy2.fr
look at the following code :
<?
$s = chr(0x0a);
print strlen($s);
$fp =fopen("test.txt","w");
fwrite($fp,$s,1);
fclose($fp);
?>
the output on screen is 1(strlen($s)) but in my file, i get always 0x0d 0x0a.
With Unix, i get only 0x0a in my file.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9282&edit=2