binary-safe fget?

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


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-10-2004
steve
 
Posts: n/a
Default binary-safe fget?

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
Reply With Quote
  #2 (permalink)  
Old 08-10-2004
Zurab Davitiani
 
Posts: n/a
Default Re: binary-safe fget?

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.
Reply With Quote
  #3 (permalink)  
Old 08-10-2004
Andy Hassall
 
Posts: n/a
Default Re: binary-safe fget?

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)
Reply With Quote
  #4 (permalink)  
Old 08-10-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: binary-safe fget?

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



Reply With Quote
  #5 (permalink)  
Old 08-10-2004
steve
 
Posts: n/a
Default Re: Re: binary-safe fget?

"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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:07 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0