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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eceaf04ab9f6c9eb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.207.66 with SMTP id fx2mr3255066qab.7.1354398563725; Sat, 01 Dec 2012 13:49:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.58.140 with SMTP id r12mr1370212qeq.35.1354398563693; Sat, 01 Dec 2012 13:49:23 -0800 (PST) Path: gf5ni37485490qab.0!nntp.google.com!i9no532063qap.0!postnews.google.com!q5g2000vbp.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 1 Dec 2012 13:49:23 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: q5g2000vbp.googlegroups.com; posting-host=87.209.50.192; posting-account=Od-2dQoAAAB0Ax1n9anxOF811WhPXsCz NNTP-Posting-Host: 87.209.50.192 References: <20121130222242.7841f869@lufsen.sandat.dyndns.org> <14df4e2f-0259-4ce0-8d5f-7a4c9964de96@g6g2000vbk.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E),gzip(gfe) Message-ID: <45386ff5-dd28-4fca-9de5-d00473655b47@q5g2000vbp.googlegroups.com> Subject: Re: Running programs using ADA From: Hans Vlems Injection-Date: Sat, 01 Dec 2012 21:49:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-12-01T13:49:23-08:00 List-Id: On 1 dec, 12:20, "Dmitry A. Kazakov" wrote: > On Sat, 1 Dec 2012 01:33:14 -0800 (PST), Hans Vlems wrote: > > the language does help in this case. > > Because the mingw C compiler bindings rely on the libraries supplied > > by Microsoft. > > The systems I've got to work with have no support for the system() > > function. > > ADA can do without them and this allows me to run various command line > > programs (with several options) without the need to have access to > > cmd.exe (which is prohibited too). > > Strictly speaking Ada cannot do this. The standard Ada run-time library > does not define any means to start a process for [good] reasons which are > irrelevant here. > > Various existing solutions always rely on libraries, which are either > compiler vendor-specific, like in the case of GNAT.OS_Lib, or OS-specific, > e.g. Win32 bindings, or [sub]standard libraries providing functionality in > a more or less OS-independent way, like POSIX , Glib, Qt. > > Note also that running processes is much more than merely spawning them. > Usually you want to get the execution status, wait for completion, attach > input/output/error pipes and so on. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Oh yes, I know it's outside the formal ADA language specification. My reference manual is quite old (Ledgard's book from 1983) and on multiprocessing it only mentions tasks. That would only work for me if I'd written everything in ADA in the first place. So that wasn't it. My VAX/VMS manuals for ADA didn't help either so therefore I asked here. The only programming language I know that has built-in support to run external programs and keep control over them is Burroughs extended algol. As the name implies, that language is tied to a hardware architecture and thus no option. I've tried the GNAT.OS_lib and it works perfectly well. All it needs to do is run a program and have it control terminal input and output. Once it stops (or crashes :) control returns to the ADA program and the user can select another option. Trivial, but very important for the small company I work for. Thanks for tour help, Hans