> 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.

My point is that the original data is munged once it goes through the
file() function.  In that sense it is not binary safe as there is no
way to restore the original data.  I agree that the new approach is more
consistent, I just want to make sure that this isn't misinterpreted in
some way as to someone documenting that this function is now binary-clean.

-Rasmus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to