Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #383067

Re: getOpsFromSelf() (Long Post)

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c
Subject Re: getOpsFromSelf() (Long Post)
Date 2024-02-26 13:38 -0800
Organization None to speak of
Message-ID <878r36x5xd.fsf@nosuchdomain.example.com> (permalink)
References <ur1ie5$2cgfo$1@dont-email.me> <jh8EdBXIFQu4WLaKt@bongo-ra.co> <urdmnf$1d3vr$2@dont-email.me> <NMK4r+7PMexyUgngk@bongo-ra.co> <fseek-20240226222154@ram.dialup.fu-berlin.de>

Show all headers | View raw


ram@zedat.fu-berlin.de (Stefan Ram) writes:
> Spiros Bousbouras <spibou@gmail.com> writes:
>>fseek(bin, -3, SEEK_END); // jump 3 bytes before end of file
>
>   A binary stream need not meaningfully support fseek calls
>   with a whence value of SEEK_END.

True, so the call is not completely portable -- but I doubt that there
are any hosted implementations that don't support such calls.

The reason for that line in the standard is to permit implementations
where, for example, binary files are represented as a sequence of
fixed-size blocks, with no information about how many bytes of the last
block are actually used.  The last block might be padded with zero
bytes.

POSIX and Windows are not the whole world, but both support binary files
that are arbitrary byte streams.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-20 06:56 +0000
  Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-24 16:19 +0000
    Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-24 17:06 +0000
      Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-24 21:25 +0000
        Re: getOpsFromSelf() (Long Post) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-24 17:59 -0800
          Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-25 11:49 +0000
            Re: getOpsFromSelf() (Long Post) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-25 14:54 -0800
              Re: getOpsFromSelf() (Long Post) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-25 22:58 +0000
              Re: getOpsFromSelf() (Long Post) dave_thompson_2@comcast.net - 2024-03-01 18:37 -0500
                Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-03-02 01:10 +0000
                Re: getOpsFromSelf() (Long Post) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-03-02 02:36 +0000
                Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-03-02 12:13 +0000
        Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-26 15:07 +0000
          Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-03-02 12:16 +0000
    Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-24 21:22 +0000
      Re: getOpsFromSelf() (Long Post) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-25 00:48 +0000
        Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-25 01:51 +0000
      Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-26 14:50 +0000
        Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-26 15:15 +0000
        Re: getOpsFromSelf() (Long Post) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-26 13:38 -0800
        Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-26 21:40 +0000
        Re: getOpsFromSelf() (Long Post) scott@slp53.sl.home (Scott Lurndal) - 2024-02-27 16:17 +0000
        Re: getOpsFromSelf() (Long Post) Spiros Bousbouras <spibou@gmail.com> - 2024-02-27 17:04 +0000
        Re: getOpsFromSelf() (Long Post) David Brown <david.brown@hesbynett.no> - 2024-02-27 18:20 +0100
    Re: getOpsFromSelf() (Long Post) scott@slp53.sl.home (Scott Lurndal) - 2024-02-25 18:42 +0000
      Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-02-26 15:20 +0000
  Re: getOpsFromSelf() (Long Post) immibis <news@immibis.com> - 2024-02-28 22:21 +0100
    Re: getOpsFromSelf() (Long Post) porkchop@invalid.foo (Mike Sanders) - 2024-03-01 00:38 +0000

csiph-web