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,92640d662fc31a03 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-04 01:48:22 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.213.69.151!news.algonet.se!newsfeed1.telenordia.se!algonet!newsfeed.sunet.se!news01.sunet.se!news.chalmers.se!licia.dtek.chalmers.se!d95lars From: Lars Lundgren Newsgroups: comp.lang.ada Subject: Re: howto make system calls (newbie question) Date: Fri, 4 May 2001 10:47:14 +0200 Organization: Chalmers University of Technology Message-ID: References: NNTP-Posting-Host: licia.dtek.chalmers.se Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nyheter.chalmers.se 988966095 20428 129.16.30.88 (4 May 2001 08:48:15 GMT) X-Complaints-To: abuse@chalmers.se NNTP-Posting-Date: 4 May 2001 08:48:15 GMT In-Reply-To: Xref: newsfeed.google.com comp.lang.ada:7141 Date: 2001-05-04T08:48:15+00:00 List-Id: On Fri, 4 May 2001, L.H.Jeong wrote: > On Fri, 4 May 2001 09:51:45 +0200, Lars Lundgren > wrote: > > >Hi there, > > > >How do I execute other programs from within ada? > > > >I.e how do I convert - for example - the following C program to ada? > > > >#include > > > >main(){ > > printf("Files in Directory are:\n"); > > system("ls -l"); > >} > > > >Thanx, > >/Lars L > > > > here is an example !! > > > procedure Command is > > function C_System(value : String) return integer; > pragma Import( > C, C_System, "system"); > > result : integer; > begin > result := C_System("pwd "); > result := C_System(value => "acdsee D:\work\pictures\BP47.jpg "); > end Command; > > > Thank you very much! That does do the trick for me. However i'm rather surprised to see you suggest that I escape ada and import C-functions. Is it really the case that such a (from my perspective) basic function can not be done solely in Ada - despite its extensive libraries? I'm not trying to start a flame, i'm just truly surprised. /Lars L