note 77893 added to function.fgets
| From: | anacreohasgmail at osu1 dot php dot net | Date: | Tue, 18 Sep 2007 21:15:53 +0000 |
| Subject: | note 77893 added to function.fgets | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130574@lists.php.net to get a copy of this message | ||
I'm using this function to modify the header of a large postscript document on copy... Works
extremely quickly so far...
function write($filename) {
$fh = fopen($this->sourceps,'r');
$fw = fopen($filename,'w');
while (!feof($fh)) {
$buffer = fgets($fh);
fwrite($fw,$buffer);
if (!$setupfound && ereg("^%%BeginSetup",$buffer)) {
$setupfound++;
if (array_key_exists("$filename",$this->output)) {
foreach ($this->output[$filename] as $function => $value) {
fwrite($fw,$value);
}
}
stream_copy_to_stream($fh,$fw);
}
}
fclose($fw);
fclose($fh);
}
----
Server IP: 209.41.74.194
Probable Submitter: 163.192.21.43
----
Manual Page -- http://www.php.net/manual/en/function.fgets.php
Edit -- https://master.php.net/note/edit/77893
Del: integrated -- https://master.php.net/note/delete/77893/integrated
Del: useless -- https://master.php.net/note/delete/77893/useless
Del: bad code -- https://master.php.net/note/delete/77893/bad+code
Del: spam -- https://master.php.net/note/delete/77893/spam
Del: non-english -- https://master.php.net/note/delete/77893/non-english
Del: in docs -- https://master.php.net/note/delete/77893/in+docs
Del: other reasons-- https://master.php.net/note/delete/77893
Reject -- https://master.php.net/note/reject/77893
Search -- https://master.php.net/manage/user-notes.php