binary-safe fget?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • steve

    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
  • Zurab Davitiani

    #2
    Re: binary-safe fget?

    steve wrote:
    [color=blue]
    > 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.[/color]

    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.

    Comment

    • Andy Hassall

      #3
      Re: binary-safe fget?

      On 10 Aug 2004 15:08:07 -0400, steve <UseLinkToEmail @dbForumz.com> wrote:
      [color=blue]
      >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.[/color]

      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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
      (v1.4.0 new 1st Aug 2004)

      Comment

      • Janwillem Borleffs

        #4
        Re: binary-safe fget?

        steve wrote:[color=blue]
        > 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.
        >[/color]




        JW



        Comment

        • steve

          #5
          Re: Re: binary-safe fget?

          "Andy Hassall" wrote:[color=blue]
          > On 10 Aug 2004 15:08:07 -0400, steve
          > <UseLinkToEmail @dbForumz.com> wrote:
          >[color=green]
          > >I understand that fget is not binary-safe before php version[/color]
          > 4.3.3.[color=green]
          > >To me that means fget cannot read binary data (or clips it to 7[/color]
          > bits).[color=green]
          > > Is there another php function equiv. to fget that is binary safe.[/color]
          > I[color=green]
          > >am not quite ready to upgrade to 4.3.3.[/color]
          >
          > 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).
          >[/color]

          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

          Comment

          Working...