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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba2f8edf6a585206 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-19 22:34:29 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: File_Type Date: 20 Apr 2004 06:30:10 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <61f665c0.0404180417.72855af4@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1082439268 7898 62.49.19.209 (20 Apr 2004 05:34:28 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 20 Apr 2004 05:34:28 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:7348 Date: 2004-04-20T06:30:10+01:00 List-Id: sk writes: > > Is there anyway to use an Integer Type like a File_Type?, > > Is there anyway to asign a File_Type the value 3? > > 1) Are you using GNAT ? > 2) Are you trying to associate the standard C/Unix integer > file types to Ada file types ? > 3) Are you comfortable with Ada ? > > If so, look at Gnat.Os_Lib and how the File_Descriptor > is defined; look at Interfaces.C_Streams. I vaguely > remember, AND I COULD BE WRONG, that there are conversion > functions somewhere in the GNAT supplied libraries. > > ... if you answered yes to #3, then you should be able > to use UC to get what you need. If you are comfortable with Ada then UC is possible for you, but to use UC one has to look at what is being converted. GNAT's Ada.Text_IO (a-textio.ads in the library sources) says package FCB renames System.File_Control_Block; type Text_AFCB; type File_Type is access all Text_AFCB; <<<<<<<<<<<<<<<<<< type Text_AFCB is new FCB.AFCB with record ... so there is *no* *way* you can hope to "use an Integer Type like a File_Type" or "asign a File_Type the value 3". -- Simon Wright 100% Ada, no bugs.