comp.lang.ada
 help / color / mirror / Atom feed
* solaris daemon question
@ 1999-07-27  0:00 darren wilson
  1999-07-28  0:00 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 2+ messages in thread
From: darren wilson @ 1999-07-27  0:00 UTC (permalink / raw)


I'm trying to write a simple daemon to run on a Sun E3500 running solaris
2.6.  Can anyone tell me how to issue command line unix statements such as
mv or cp and such from within an ada program?  I've been programming in
ada for a while, but have never done this.  Any help is appreciated.

Thanks in advance
Darren
dwilson@capital.net




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

* Re: solaris daemon question
  1999-07-27  0:00 solaris daemon question darren wilson
@ 1999-07-28  0:00 ` David C. Hoos, Sr.
  0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos, Sr. @ 1999-07-28  0:00 UTC (permalink / raw)


darren wilson wrote in message <7nl2l8$cg9$1@Usenet.Logical.NET>...
>I'm trying to write a simple daemon to run on a Sun E3500 running solaris
>2.6.  Can anyone tell me how to issue command line unix statements such as
>mv or cp and such from within an ada program?  I've been programming in
>ada for a while, but have never done this.  Any help is appreciated.
>

Here's an interface to the "system" C library function:

with Ada.Characters.Latin_1;
with System;
function Execute_Shell_Command
           (The_Command : String) return Integer is
   function Execute
              (The_Command_Address : System.Address) return Integer;
   pragma Import (C, Execute, "system");
   The_Nul_Terminated_Command_String : constant String :=
     The_Command & Ada.Characters.Latin_1.Nul;
begin
   return Execute (The_Nul_Terminated_Command_String'Address);
end Execute_Shell_Command;








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

end of thread, other threads:[~1999-07-28  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-27  0:00 solaris daemon question darren wilson
1999-07-28  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