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


Groups > comp.lang.c > #124012

Re: do repeating fopen make an error?

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: do repeating fopen make an error?
Date 2017-12-08 08:05 -0800
Organization None to speak of
Message-ID <lnbmj9tdbw.fsf@kst-u.example.com> (permalink)
References (1 earlier) <p0bjnr$1cc$10@toylet.eternal-september.org> <0a6c8c2f-444d-4155-bb10-ebccd3eb9b24@googlegroups.com> <p0drkv$mp4$1@toylet.eternal-september.org> <41c2cb1c-793f-4cad-aedc-145192a86aa5@googlegroups.com> <%RvWB.77146$zp3.43998@fx12.iad>

Show all headers | View raw


Richard Damon <Richard@Damon-Family.org> writes:
> On 12/8/17 7:18 AM, Chad wrote:
[...]
>> And what happens if I use fopen() on an OS that has no notion of a
>> file descriptor? For example, I know of legacy OS's that have no
>> notion of a file descriptor. Because in the K & R book, they make a
>> distinction.
>
> The OS doesn't need to have file descriptors. The C Standard says that 
> fopen returns a file descriptor, if the OS has a compatible function to 
> call that returns one, the implementation can just forward to that. If 
> the OS doesn't, then the implementation can provide the file descriptors 
> (often in an array, with the 'file descriptor' returned being the index 
> into that array).

The C standard says exactly nothing about file descriptors.  fopen()
returns a FILE* pointer; the contents of type FILE are unspecified.
(The term "file descriptor" usually refers to a small integer value
returned by the POSIX open() function.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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


Thread

do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-06 15:37 -0800
  Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-06 16:21 -0800
  Re: do repeating fopen make an error? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-12-07 22:37 +0800
    Re: do repeating fopen make an error? Chad <cdalten@gmail.com> - 2017-12-08 01:18 -0800
      Re: do repeating fopen make an error? Chad <cdalten@gmail.com> - 2017-12-08 01:33 -0800
      Re: do repeating fopen make an error? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-12-08 19:05 +0800
        Re: do repeating fopen make an error? Chad <cdalten@gmail.com> - 2017-12-08 04:18 -0800
          Re: do repeating fopen make an error? Richard Damon <Richard@Damon-Family.org> - 2017-12-08 07:47 -0500
            Re: do repeating fopen make an error? Keith Thompson <kst-u@mib.org> - 2017-12-08 08:05 -0800
              Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-08 08:27 -0800
                Re: do repeating fopen make an error? bartc <bc@freeuk.com> - 2017-12-08 16:59 +0000
                Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-08 10:30 -0800
                Re: do repeating fopen make an error? Chad <cdalten@gmail.com> - 2017-12-08 10:43 -0800
                Re: do repeating fopen make an error? supercat@casperkitty.com - 2017-12-08 11:52 -0800
            Re: do repeating fopen make an error? "Peter \"Shaggy\" Haywood" <phaywood@alphalink.com.au> - 2017-12-09 11:34 +1100
          Re: do repeating fopen make an error? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2017-12-08 23:06 +0800
            Re: do repeating fopen make an error? supercat@casperkitty.com - 2017-12-08 08:03 -0800
        Re: do repeating fopen make an error? gordonb.zy1op@burditt.org (Gordon Burditt) - 2017-12-09 13:07 -0600
  Re: do repeating fopen make an error? mark.bluemel@gmail.com - 2017-12-08 02:56 -0800
    Re: do repeating fopen make an error? supercat@casperkitty.com - 2017-12-08 07:57 -0800
    Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-08 08:17 -0800
  Re: do repeating fopen make an error? gordonb.29zvv@burditt.org (Gordon Burditt) - 2017-12-09 13:00 -0600
    Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-09 14:45 -0800
      Re: do repeating fopen make an error? fir <profesor.fir@gmail.com> - 2017-12-09 15:25 -0800

csiph-web