comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: File_Type
Date: 20 Apr 2004 06:30:10 +0100
Date: 2004-04-20T06:30:10+01:00	[thread overview]
Message-ID: <x7v8ygrp671.fsf@smaug.pushface.org> (raw)
In-Reply-To: mailman.26.1082325482.314.comp.lang.ada@ada-france.org

sk <noname@myob.com> 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.



  reply	other threads:[~2004-04-20  5:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-18 12:17 File_Type Jorge Suarez-Solis Rivaya
2004-04-18 16:30 ` File_Type Martin Krischik
2004-04-18 20:47 ` File_Type tmoran
2004-04-18 22:02 ` File_Type sk
2004-04-20  5:30   ` Simon Wright [this message]
2004-04-20  8:08     ` File_Type Ludovic Brenta
2004-04-20 19:39       ` File_Type Keith Thompson
2004-04-20  8:23     ` File_Type sk
2004-04-18 22:11 ` File_Type Marius Amado Alves
2004-04-18 23:17   ` File_Type Georg Bauhaus
2004-04-21 17:03     ` File_Type Warren W. Gay VE3WWG
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox