* How to redirect std.-output to a textfile?
@ 1999-05-21 0:00 Andreas Hoffmann
1999-05-21 0:00 ` Dale Stanbrough
1999-05-21 0:00 ` David C. Hoos, Sr.
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Hoffmann @ 1999-05-21 0:00 UTC (permalink / raw)
Hello,
How can i redirect the standard-output to a textfile.
I can't use put(myfile,something), because the output is done by a
Procedure in a
precompiled package.
Pleas help me with some links our a little bit of code.
Thanks in advance.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to redirect std.-output to a textfile?
1999-05-21 0:00 How to redirect std.-output to a textfile? Andreas Hoffmann
1999-05-21 0:00 ` Dale Stanbrough
@ 1999-05-21 0:00 ` David C. Hoos, Sr.
1 sibling, 0 replies; 5+ messages in thread
From: David C. Hoos, Sr. @ 1999-05-21 0:00 UTC (permalink / raw)
Andreas Hoffmann <andreas3@minet.uni-jena.de> wrote in message
news:37453F4F.53BA2EC8@minet.uni-jena.de...
> Hello,
>
> How can i redirect the standard-output to a textfile.
> I can't use put(myfile,something), because the output is done by a
> Procedure in a
> precompiled package.
>
> Pleas help me with some links our a little bit of code.
>
This is not an Ada question. If you can't do
Ada.Text_IO.Put (Ada.text_IO.Standard_Output, Something),
then you need to redirect within your command shell on the
command line --g.g.,:
program_name > file_name
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to redirect std.-output to a textfile?
1999-05-21 0:00 ` Dale Stanbrough
@ 1999-05-21 0:00 ` Andreas Hoffmann
1999-05-21 0:00 ` David C. Hoos, Sr.
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Hoffmann @ 1999-05-21 0:00 UTC (permalink / raw)
> Ada.Text_IO.Set_Output (myfile);
Tanks very much, it works fine!
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to redirect std.-output to a textfile?
1999-05-21 0:00 ` Andreas Hoffmann
@ 1999-05-21 0:00 ` David C. Hoos, Sr.
0 siblings, 0 replies; 5+ messages in thread
From: David C. Hoos, Sr. @ 1999-05-21 0:00 UTC (permalink / raw)
Andreas Hoffmann <andreas3@minet.uni-jena.de> wrote in message
news:3745564B.24A460B0@minet.uni-jena.de...
>
> > Ada.Text_IO.Set_Output (myfile);
>
> Tanks very much, it works fine!
This may be splitting semantic hairs, but Set_Output _does not_
redirect standard output -- it simply sets the _default_
output -- i.e., the file to which the is written the result of
file operations such as Put, Put_Line, New_Line, etc., in the
absence of the File parameter in the call.
Even though the _default output_ has been written to some
specific file, a statement such as
Put_Line (Standard_Output, Something) will still be written
to the _standard output_, even though the _default output_
has been set to some specific file.
Sometimes the answer is wrong because the question is not
correctly put .
Here are a few relevant lines from the RM, section A.10.3
procedure Set_Output(File : in File_Type);
procedure Set_Error (File : in File_Type);
6 Each operates on a file of mode Out_File or Append_File.
Set_Output sets the current default output file to File.
Set_Error sets the current default error file to File.
The exception Status_Error is propagated if the given file
is not open. The exception Mode_Error is propagated if the
mode of the given file is not Out_File or Append_File.
7 function Standard_Input return File_Type;
function Standard_Input return File_Access;
8 Returns the standard input file (see A.10), or an access
value designating the standard input file, respectively.
9 function Standard_Output return File_Type;
function Standard_Output return File_Access;
10 Returns the standard output file (see A.10) or an access
value designating the standard output file, respectively.
11 function Standard_Error return File_Type;
function Standard_Error return File_Access;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to redirect std.-output to a textfile?
1999-05-21 0:00 How to redirect std.-output to a textfile? Andreas Hoffmann
@ 1999-05-21 0:00 ` Dale Stanbrough
1999-05-21 0:00 ` Andreas Hoffmann
1999-05-21 0:00 ` David C. Hoos, Sr.
1 sibling, 1 reply; 5+ messages in thread
From: Dale Stanbrough @ 1999-05-21 0:00 UTC (permalink / raw)
Andreas Hoffmann wrote:
"How can i redirect the standard-output to a textfile.
I can't use put(myfile,something)"
Ada.Text_IO.Set_Output (myfile);
Dale
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-05-21 0:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-21 0:00 How to redirect std.-output to a textfile? Andreas Hoffmann
1999-05-21 0:00 ` Dale Stanbrough
1999-05-21 0:00 ` Andreas Hoffmann
1999-05-21 0:00 ` David C. Hoos, Sr.
1999-05-21 0:00 ` David C. Hoos, Sr.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox