Req #36289 [Asn->Csd]: Implement SplBinaryFileObject
| From: | cmb@php.net | Date: | Tue, 25 Oct 2016 17:29:52 +0000 |
| Subject: | Req #36289 [Asn->Csd]: Implement SplBinaryFileObject | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205006@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=36289&edit=1
ID: 36289
Updated by: cmb@php.net
Reported by: robertpaul at gmail dot com
Summary: Implement SplBinaryFileObject
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: SPL related
Operating System: *
PHP Version: *
Assigned To: helly
Block user comment: N
Private report: N
New Comment:
As of PHP 5.5.11 SplFileObject::fread() is available, so this
ticket can be closed.
Previous Comments:
------------------------------------------------------------------------
[2006-02-05 17:04:15] helly@php.net
Yes, maybe we can implement a SplBinaryFileObject class. That would have all those functions.
Actually an interesting idea.
------------------------------------------------------------------------
[2006-02-05 16:52:03] robertpaul at gmail dot com
I see ... thanks for the quick reply. So is it fair to say, then, that SplFileObject isn't
suitable for reading a binary file?
Thanks again,
--Rob
------------------------------------------------------------------------
[2006-02-05 12:54:56] helly@php.net
SplFileObject is a line iterator, that is it reads the next line on current() and friends.
Introducing fread would mean one would need to cound the '\n's after reading some bytes.
That said it would be ok to read the remainder as from the object since then valid() would return
true and the number of lines wouldn't matter. An alternative would be allowing to skip line
counting. However right now fread() in its current forma does not make sense.
------------------------------------------------------------------------
[2006-02-05 00:32:23] robertpaul at gmail dot com
Description:
------------
Please forgive me if I'm missing something, but it seems as though SplFileObject has most of
the useful file functions except fread. Having that available would be Really Good.
Thanks!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=36289&edit=1