comp.lang.ada
 help / color / mirror / Atom feed
* Win32 File Handles and Ada
@ 1998-05-30  0:00 Srinivasan, R
  1998-05-31  0:00 ` Robert Dewar
  1998-05-31  0:00 ` Jerry van Dijk
  0 siblings, 2 replies; 4+ messages in thread
From: Srinivasan, R @ 1998-05-30  0:00 UTC (permalink / raw)



folks

Environment : Win NT 4.0

I am looking for a way to map Win32 File handles - created by CreatePipe
for instance into Ada Text_Io.File_Type (or some other such construct
that is close).

Can anyone suggest a way for gnat (3.10p1)?

How about Aonix?

Any pointers would be appreciated.

Thanks

Srini





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Win32 File Handles and Ada
  1998-05-30  0:00 Win32 File Handles and Ada Srinivasan, R
@ 1998-05-31  0:00 ` Robert Dewar
  1998-05-31  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1998-05-31  0:00 UTC (permalink / raw)




Srini asks

<<I am looking for a way to map Win32 File handles - created by CreatePipe
for instance into Ada Text_Io.File_Type (or some other such construct
that is close).

Can anyone suggest a way for gnat (3.10p1)?
>>


GNAT contains EXACTLY the feature you need (assuming that Win32 file handles
are treated the same as C stream handles). See the GNAT documentation which
has a seection called Operations on C Streams. If this is not exactly what
you want, it should be trivial to modify the Ada.Text_IO.C_Streams package
to
do what you want.

It is a constant amazement to me that people do not make the effort to at
least breeze through the documentation to know what is there. 

I really encourage GNAT users, both those using the supported
commercial version, and those using the public version to take the
time to read the documentation, there is all sorts of interesting stuff
available there.

Robert Dewar
Ada Core Technologies





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Win32 File Handles and Ada
  1998-05-30  0:00 Win32 File Handles and Ada Srinivasan, R
  1998-05-31  0:00 ` Robert Dewar
@ 1998-05-31  0:00 ` Jerry van Dijk
  1998-06-03  0:00   ` Srinivasan, R
  1 sibling, 1 reply; 4+ messages in thread
From: Jerry van Dijk @ 1998-05-31  0:00 UTC (permalink / raw)



Srinivasan, R (gitas@roanoke.infi.net) wrote:

: Environment : Win NT 4.0

: I am looking for a way to map Win32 File handles - created by CreatePipe
: for instance into Ada Text_Io.File_Type (or some other such construct
: that is close).

You invoke quite a number of issues here...

1) The Ada.Text_IO.File_Type is a limited private type, how it is
   defined depends on you particular Ada Runtime Library Environment.
   Most likely, it will be different for all compilation systems.
   You seem to assume that File_Type will be a File Handle. This might
   or might not be true.

2) a Win32 File Handle can be many things, like a Windows Handle, a
   C type file handle or file descriptor, but also a Asynchronous
   Windows Handle that acts like a C file descriptor...
   You have to be absolutely clear on what you are talking about here.

What your question seems to be is: 

	How can I use the Text_IO functions and procedures to
	read and write on Win32 pipes.

which is a different question.

The answer is: you implement them on top of the Win32 binding.

For an example you could take a peek at my Win32 port of AdaSockets,
which does a simular thing for reading/writing through sockets.
The source is at http://stad.dsl.nl/~jvandyk

Jerry.
-- 
-- Jerry van Dijk  | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Win32 File Handles and Ada
  1998-05-31  0:00 ` Jerry van Dijk
@ 1998-06-03  0:00   ` Srinivasan, R
  0 siblings, 0 replies; 4+ messages in thread
From: Srinivasan, R @ 1998-06-03  0:00 UTC (permalink / raw)



Exactly the info I was looking for. Thanks

Srini





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-06-03  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-30  0:00 Win32 File Handles and Ada Srinivasan, R
1998-05-31  0:00 ` Robert Dewar
1998-05-31  0:00 ` Jerry van Dijk
1998-06-03  0:00   ` Srinivasan, R

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