From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d9614dc5d212676 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: solaris daemon question Date: 1999/07/28 Message-ID: <7nmqu7$lgu@hobbes.crc.com>#1/1 X-Deja-AN: 506160094 References: <7nl2l8$cg9$1@Usenet.Logical.NET> Organization: Coleman Research Corporation X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Newsgroups: comp.lang.ada Date: 1999-07-28T00:00:00+00:00 List-Id: 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;