comp.lang.ada
 help / color / mirror / Atom feed
* Pipe UNIX-commands
@ 1996-07-04  0:00 Markus Wahl
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Wahl @ 1996-07-04  0:00 UTC (permalink / raw)



I'd like to know how I can make unix-commands from inside my ada-program.

Eg: The program shall pipe out the command 'ls' and then make something
within the program with the output of 'ls'. Am I clear?

Please reply booth to my e-mail adress and to this newsgroup.

Thanks in advance.

/Markus

"Ouvre le Chien." (Open the dogs) - David Bowie





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

* Pipe UNIX-commands
@ 1996-08-20  0:00 Markus Wahl
  1996-08-21  0:00 ` Stephen & Tammy House
  1996-08-21  0:00 ` Larry Hazel
  0 siblings, 2 replies; 5+ messages in thread
From: Markus Wahl @ 1996-08-20  0:00 UTC (permalink / raw)




I'd like to know how I can make unix-commands from inside my ada-program.

Eg: The program shall pipe out the command 'ls' and then make something
within the program with the output of 'ls'. Am I clear?

Please reply booth to my e-mail adress and to this newsgroup.

Thanks in advance.

/Markus

"Ouvre le Chien." (Open the dogs) - David Bowie






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

* Re: Pipe UNIX-commands
  1996-08-20  0:00 Markus Wahl
  1996-08-21  0:00 ` Stephen & Tammy House
@ 1996-08-21  0:00 ` Larry Hazel
  1996-08-23  0:00   ` Markus Wahl
  1 sibling, 1 reply; 5+ messages in thread
From: Larry Hazel @ 1996-08-21  0:00 UTC (permalink / raw)
  To: Markus Wahl


Markus Wahl wrote:
> 
> I'd like to know how I can make unix-commands from inside my ada-program.
> 
> Eg: The program shall pipe out the command 'ls' and then make something
> within the program with the output of 'ls'. Am I clear?

I don't remember the details of the unix system call, I think it may be
'system' (try 'man system' to check it out).  I no longer have access to
unix.  Anyway, you can import this C function and run any command from
your Ada program that you can run from the shell prompt and can include
I/O redirection.  Something like:

with Interfaces.C;

   procedure Execute_Unix_Command (Command_Line :
Interfaces.C.Char_Array);
   pragma Import (C, Execute_Unix_Command, "system");

   ...

   Execute_Unix_Command (Interfaces.C.To_C ("ls > result_file"));

Now you can open result_file with Text_IO and read it.  There are
probably other ways.

Hope this helps

-- Larry Hazel => Larry.H.Hazel@cpmx.saic.com (205) 876-4509
-- I try to stay above C level,  I get C sick.
-- Team Ada & Team OS/2




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

* Re: Pipe UNIX-commands
  1996-08-20  0:00 Markus Wahl
@ 1996-08-21  0:00 ` Stephen & Tammy House
  1996-08-21  0:00 ` Larry Hazel
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen & Tammy House @ 1996-08-21  0:00 UTC (permalink / raw)
  To: Markus Wahl


Markus Wahl wrote:
> 
> I'd like to know how I can make unix-commands from inside my ada-program.
> 
> Eg: The program shall pipe out the command 'ls' and then make something
> within the program with the output of 'ls'. Am I clear?
> 
> Please reply booth to my e-mail adress and to this newsgroup.
> 
> Thanks in advance.
> 
> /Markus
> 
> "Ouvre le Chien." (Open the dogs) - David Bowie
Have you tried reading from Standard_In?  I think you just have to be
aware that and End_Error is temporary condition until the system can get
some more stuff buffered up.  I'm not sure, but I think we've got some
utilities at work that work that way.  Let me know if I'm wrong.  I'd
hate to be running around with that stuck in my head if its not right.




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

* Re: Pipe UNIX-commands
  1996-08-21  0:00 ` Larry Hazel
@ 1996-08-23  0:00   ` Markus Wahl
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Wahl @ 1996-08-23  0:00 UTC (permalink / raw)



On Wed, 21 Aug 1996, Larry Hazel wrote:

> > I'd like to know how I can make unix-commands from inside my ada-program.

> > Eg: The program shall pipe out the command 'ls' and then make something
> > within the program with the output of 'ls'. Am I clear?

> I don't remember the details of the unix system call, I think it may be
> 'system' (try 'man system' to check it out).  I no longer have access to
> unix.  Anyway, you can import this C function and run any command from
> your Ada program that you can run from the shell prompt and can include
> I/O redirection.


Pitty I can't write C. Maybe someone else knows a solution suitable
for me. Thank you anyway.

/Markus

The government can take everything but your paranoia.





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

end of thread, other threads:[~1996-08-23  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-04  0:00 Pipe UNIX-commands Markus Wahl
  -- strict thread matches above, loose matches on Subject: below --
1996-08-20  0:00 Markus Wahl
1996-08-21  0:00 ` Stephen & Tammy House
1996-08-21  0:00 ` Larry Hazel
1996-08-23  0:00   ` Markus Wahl

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