comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Fill string with multiple lines from standard_input
Date: Wed, 21 Aug 2002 14:19:43 -0500
Date: 2002-08-21T14:19:43-05:00	[thread overview]
Message-ID: <um7ptk6238ap6f@corp.supernews.com> (raw)
In-Reply-To: aju1tq$qna$07$1@news.t-online.com

Vincent Smeets wrote in message ...
>
>This will bring be back to my other problem. If I use the streams from
>Ada.Text_IO.Text_Streams I will lose the <CR>s.
>
>I can't use Ada.Streams.Stream_IO either because I can't read from the
>standard input with that package. You can only read from files that are
>opened first by Stream_IO.Open call. I would need the following
function
>like in Text_IO:
>    function Standard_Input
>        return Ada.Streams.Stream_IO.File_Type;


That is exactly what Ada.Text_IO.Text_Streams gives you. (I can't
imagine an implementor doing something else...)

Probably your problem is that the OS is eating the <CR>s from Standard
Input, and Ada never sees them. I would expect that you would find this
behavior with any file type that read from the Standard Input handle.

In the mail handling code I've written, I simply assume that the <CR>s
are where they are supposed to be by the RFCs, and put them back in as
needed. Mail that violates RFCs is almost certainly spam anyway; don't
worry about that causing problems, just dump it.

(Bare <CR>s and <LF>s are prohibited by the mail and MIME RFCs anyway,
no mail should have such characters, and what mail servers do with such
mail is undefined. <CR>s paired with <LF>s can always be inserted [and
should be inserted] if you get any bare line ending characters.)

            Randy Brukardt
            (Working on a spam mail filter for the IMS mail server,
written in Ada.)





>Thanks,
>Vincent
>
>





  parent reply	other threads:[~2002-08-21 19:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-14 19:34 Fill string with multiple lines from standard_input Vincent Smeets
2002-08-14 20:37 ` Stephen Leake
2002-08-15 17:57   ` Vincent Smeets
2002-08-15 20:47     ` Stephen Leake
2002-08-19 19:39       ` Vincent Smeets
2002-08-20 15:01         ` Stephen Leake
2002-08-20 18:26           ` Vincent Smeets
2002-08-20 19:46             ` tmoran
2002-08-21 12:50             ` Jean-Pierre Rosen
2002-08-21 19:19             ` Randy Brukardt [this message]
2002-08-25  0:34               ` AG
2002-08-21 14:37         ` Kevin Cline
2002-08-21 19:47           ` Robert Dewar
2002-08-22  7:40             ` Kevin Cline
2002-08-23 19:49               ` Peter Richtmyer
2002-08-22 20:36             ` Kevin Cline
2002-08-25  0:45               ` AG
2002-08-26  0:47                 ` Kevin Cline
2002-08-15  2:30 ` SteveD
2002-08-15 18:02   ` Vincent Smeets
2002-08-16  0:25     ` Robert Dewar
2002-08-15 19:07   ` Vincent Smeets
2002-08-15 21:49     ` chris.danx
2002-08-16 19:30       ` Ted Dennison
2002-08-17  2:26         ` Randy Brukardt
2002-08-17 10:24         ` Robert Dewar
2002-08-19 13:40           ` Ted Dennison
2002-08-20  0:03             ` Robert Dewar
2002-08-16 17:33 ` Alexei Polkhanov
replies disabled

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