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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,439c480fcf4ce979 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-14 08:00:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.vmunix.org!npeer.de.kpn-eurorings.net!news.erfurt.igrz.de!drcomp.erfurt.thur.de!not-for-mail From: Adrian Knoth Newsgroups: comp.lang.ada Subject: Re: Exec shell command with GNAT Date: 14 Jan 2003 15:41:50 GMT Organization: Modern Electronics Message-ID: References: NNTP-Posting-Host: drcomp.erfurt.thur.de X-Server-Date: 14 Jan 2003 15:41:50 GMT User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:33006 Date: 2003-01-14T15:41:50+00:00 List-Id: Thomas Wolf wrote: > Yes, that's it. My own version looks similar: > function Execute (Command : in String) return Integer > is > function Run (Command : in Interfaces.C.char_array) > return Interfaces.C.int; > pragma Import (C, Run, "system"); > begin -- Execute > return Integer (Run (Interfaces.C.To_C (Item => Command))); > end Execute; > No fiddling around with addresses needed, There is even less fiddling: procedure my_C_system (command : in String) is function Internal (command : in String) return Integer; pragma Import (C, Internal, "system"); result : Integer; begin result := Internal (command & ASCII.Nul); end my_C_system; -- mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver Windows 98? Warum? Ich hab' das alte noch nicht zu Ende gespielt.