[chora] Fwd: Binary files and co.php

Chuck Hagenbuch chuck at horde.org
Sat Apr 12 13:30:11 PDT 2003



----- Forwarded message from terzo at corp.earthlink.net -----
    Date: Sat, 12 Apr 2003 10:42:39 -0400
    From: mike <terzo at corp.earthlink.net>
Reply-To: mike <terzo at corp.earthlink.net>
 Subject: Binary files and co.php
      To: chuck at horde.org

Hey man,

Been using chora for a while now..  It's way cool.

I had a problem with binary files.  my php build is 4.2.  The function fgets
is not binary safe in anything earlier than 4.3.  What I had to do was on
line 102 I changed the while loop to be

while(!feof($fp)){
    $line = fgetc($fp);
    flush();
}

# echo $content;

sucks that you have to get it 1 at a time.. but this is the only binary safe
file handle reader, in earlier versions.  Everything else requires that you
pass it the file name.  Can't quit do that when $fp is a pipe.

anyways. thought you may like to know that.

--mike



----- End forwarded message -----


-chuck

--
Charles Hagenbuch, <chuck at horde.org>
"... It is not more light we need, but more warmth! We die of cold, not of
darkness. It is not the night that kills, but the frost." - Miguel de
Unamuno


More information about the chora mailing list