This is a discussion on binary-safe fget? within the PHP Language forums, part of the PHP Programming Forums category; I understand that fget is not binary-safe before php version 4.3.3. To me that means fget cannot ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I understand that fget is not binary-safe before php version 4.3.3.
To me that means fget cannot read binary data (or clips it to 7 bits). Is there another php function equiv. to fget that is binary safe. I am not quite ready to upgrade to 4.3.3. Thanks. -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbForumz.com/PHP-binary-s...ict138381.html Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=462446 |
|
|||
|
steve wrote:
> I understand that fget is not binary-safe before php version 4.3.3. > To me that means fget cannot read binary data (or clips it to 7 bits). > Is there another php function equiv. to fget that is binary safe. I > am not quite ready to upgrade to 4.3.3. There is no function fget. fgets is not binary safe until version 4.3 (not 4.3.3). fgetc is binary safe. fread, which is referenced from fgets documentation page on php.net, is binary safe. Also read the fopen docs if you are on Windows. |
|
|||
|
On 10 Aug 2004 15:08:07 -0400, steve <UseLinkToEmail@dbForumz.com> wrote:
>I understand that fget is not binary-safe before php version 4.3.3. >To me that means fget cannot read binary data (or clips it to 7 bits). > Is there another php function equiv. to fget that is binary safe. I >am not quite ready to upgrade to 4.3.3. PHP doesn't have an fget function, do you want fgets (read line from file pointer)? If so you could make this from fread (read in chunks, scan for newline, return line and save the rest or rewind the file pointer) or fgetc (read character by character until newline, bound to be slower though). -- Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk> <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool (v1.4.0 new 1st Aug 2004) |
|
|||
|
steve wrote:
> I understand that fget is not binary-safe before php version 4.3.3. > To me that means fget cannot read binary data (or clips it to 7 bits). > Is there another php function equiv. to fget that is binary safe. I > am not quite ready to upgrade to 4.3.3. > http://www.php.net/manual/en/function.fgetc.php JW |
|
|||
|
"Andy Hassall" wrote:
> On 10 Aug 2004 15:08:07 -0400, steve > <UseLinkToEmail@dbForumz.com> wrote: > > >I understand that fget is not binary-safe before php version > 4.3.3. > >To me that means fget cannot read binary data (or clips it to 7 > bits). > > Is there another php function equiv. to fget that is binary safe. > I > >am not quite ready to upgrade to 4.3.3. > > PHP doesn’t have an fget function, do you want fgets (read line > from file > pointer)? > > If so you could make this from fread (read in chunks, scan for > newline, return > line and save the rest or rewind the file pointer) or fgetc (read > character by > character until newline, bound to be slower though). > Thanks, Andy. I did mean fgets. Ok, you are right. I can use fread. -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbForumz.com/PHP-binary-s...ict138381.html Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=462527 |