Re: cvs: php4 /ext/standard file.c /main php_streams.h streams.c
| From: | Ilia A. | Date: | Fri, 18 Oct 2002 20:48:12 +0000 |
| Subject: | Re: cvs: php4 /ext/standard file.c /main php_streams.h streams.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-15031@lists.php.net to get a copy of this message | ||
On October 18, 2002 04:40 pm, Rasmus Lerdorf wrote:
> > Fixed bug #19971 (optimized the file() function).
> > The file() function is now also binary safe.
>
> That's a bit misleading. By definition file() cannot be binary-safe in
> that \n is treated specially.
Not quite, in the old code (4.2.3) doing a file() would produce a wildly
inaccurate count of lines. For example, a php executable was only 2200 lines,
while 'wc -l' and manual checks using C yielded a result of 9800 lines. In my
mind that meant that the old code was un-safe to use on binary files.
The new code works properly and breaks down the file by lines accurately.
Ilia
P.S. Thanks to Wez & Sascha we also support MAC EOL in 4.3.0, so we don't look
for \n specifically per say.