comp.lang.ada
 help / color / mirror / Atom feed
* plain Ada streams with Windows(TM)
@ 2006-05-02  1:24 Georg Bauhaus
  2006-05-02 21:03 ` Randy Brukardt
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2006-05-02  1:24 UTC (permalink / raw)


Hello, for a Windows console application using
only plain Ada, is there a way to open standard
input/output using Stream_IO.Open, but not using
Text_Streams? [*]

I have been trying

  open(f, In_File, "CONIN$");

However, this seems to tie input to the console
buffer, i.e., redirected or piped input to my program
doesn't come in. (Besides, the SDK docs say I have to
open shared. A Form string is not supported by
one of the Ada implementations I have, AFAICS.)

The UNIX equivalent (or so I thought)

  open(f, In_File, "/dev/stdin");

works well (with a GNU/Linux system).

Is there a way out, or will I have to write my own
stream? (for a small free software tool, actually.)


[*] Different implementations of Text_IO.Text_Streams,
and in particular Wide_Text_IO.Text_Streams, seem to have
some problems.  Being twice as slow as Stream_IO (GNAT)
is a minor one.
GNAT writes characters not requested when creating a new
stream/file. I find this puzzling (Is this correct?).
Wide_Text_IO.Text_Streams is not working, really, in
OA and hence not an option, obviously.

-- Georg 







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

* Re: plain Ada streams with Windows(TM)
  2006-05-02  1:24 plain Ada streams with Windows(TM) Georg Bauhaus
@ 2006-05-02 21:03 ` Randy Brukardt
  2006-05-03 14:43   ` Georg Bauhaus
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Brukardt @ 2006-05-02 21:03 UTC (permalink / raw)


"Georg Bauhaus" <bauhaus@futureapps.de> wrote in message
news:1146533046.9010.38.camel@localhost.localdomain...
> Hello, for a Windows console application using
> only plain Ada, is there a way to open standard
> input/output using Stream_IO.Open, but not using
> Text_Streams? [*]

I don't think so; there is no name for the files. The program is given the
handles at start-up.

Janus/Ada provides some built-in names to access them ("STI:", "STO:", and
"ERR:"), a feature carried over from our MS-DOS compilers. But this is
implemented completely in the Janus/Ada runtime (it just binds the files to
the appropriate handles). I don't think that there is any portable way to do
it. (But I didn't think there was any on Unix systems, either.)

                              Randy.





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

* Re: plain Ada streams with Windows(TM)
  2006-05-02 21:03 ` Randy Brukardt
@ 2006-05-03 14:43   ` Georg Bauhaus
  2006-05-05  2:27     ` Craig Carey <research@ijs.co.nz>
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2006-05-03 14:43 UTC (permalink / raw)


Randy Brukardt wrote:

> Janus/Ada provides some built-in names to access them ("STI:", "STO:", and
> "ERR:"), a feature carried over from our MS-DOS compilers. But this is
> implemented completely in the Janus/Ada runtime (it just binds the files to
> the appropriate handles). I don't think that there is any portable way to do
> it. 

Thanks. That'll make me chose Text_Streams then, in the default Windows
version.


-- Georg 



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

* Re: plain Ada streams with Windows(TM)
  2006-05-03 14:43   ` Georg Bauhaus
@ 2006-05-05  2:27     ` Craig Carey <research@ijs.co.nz>
  0 siblings, 0 replies; 4+ messages in thread
From: Craig Carey <research@ijs.co.nz> @ 2006-05-05  2:27 UTC (permalink / raw)


Text_Streams is perhaps too slow?.

It seems that Ada 95 can't do I/O and vendors don't wish to modify
Annex to make even the tinies most essential changes.

Perhaps the worst of Ada.Text_IO is that it truncates on truncates when
hitting a file ending character.

What is needed is Ada bindings to C stream routines, and ideally all
GNU I/O routines provided that the bindings run with the MSVCRT DLL.

Florist POSIX and Mr Obry's Win32 version does not seem useful. GNAT
*Crt* files are somewhat incomplete, and lack a version of the GNU C
Lib getline () routine that can use the MSVCRT fgets () or whatever it
is.

Ada's Annex A I/O offerings do not seem to have acceptable quality for
DragonflyBSD/FreeBSD etceta. (Possibly Mr Krischik could tell us if Ada
has an I/O subsystem that is of acceptable virtue for wiki-Linux...)

--




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

end of thread, other threads:[~2006-05-05  2:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02  1:24 plain Ada streams with Windows(TM) Georg Bauhaus
2006-05-02 21:03 ` Randy Brukardt
2006-05-03 14:43   ` Georg Bauhaus
2006-05-05  2:27     ` Craig Carey <research@ijs.co.nz>

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