From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Tue, 11 May 2010 17:54:27 +0200 Organization: Ada At Home Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> NNTP-Posting-Host: EFpv4lnpRyjbMhM0po550g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:11497 Date: 2010-05-11T17:54:27+02:00 List-Id: Le Tue, 11 May 2010 09:58:16 +0200, Maciej Sobczak = a =C3=A9crit: > On 11 Maj, 00:24, Yannick Duch=C3=AAne (Hibou57) > wrote: > >> Only as long as you only rely on fopen ; > > This function is defined in the C standard. > >> there is also an "int open(char * filename, int flags)" which is wide= ly = >> used. > > This one is not defined in the C standard and as such is not part of > the C language. So C writers do not enforce standards. This "open" is even more widely = used than "fopen", I use to see it every-where. Note : I knew open is not part of ISO/ANSI C, I was teasing you about a = = trouble with C sources. >> Weither or not this "int" actually stands for a pointer is another = >> story (as in C one will always be able to cast from int to void*, thi= s = >> may be true indeed). > > No this is not true either - assuming that you mean the "open" > function defined in the POSIX standard, the return value is the lowest= > *numbered* unused file descriptor. This is aligned with the semantics > of other functions like select. > > Another reason for why this cannot be a pointer is that NULL is > defined to be a pointer value that does *not* point to any object; at > the same time STDIN_FILENO, denoting a file descriptor for standard > input, has a value 0, which is equivalent to NULL. True, clever notice > Interestingly, Unix file descriptors are *much safer* than standard > C's FILE pointers in that they are free from undefined behavior. Of > course, it would be even better to have a distinct type for them. > > (OK, that's enough for off-topic confusions, I duck away to reinvent > My_Better.Text_IO on top of Ada.Streams ;-) ) Please, what does mean =E2=80=9Cto duck away=E2=80=9D ? -- = pragma Asset ? Is that true ? Waaww... great