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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d87fe6752812f07a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Example of Spawn call Reply-To: anon@anon.org (anon) References: <50d832b4-140d-4029-8d7c-9397115160ba@u8g2000yqn.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Sat, 02 May 2009 06:28:33 GMT NNTP-Posting-Host: 12.64.48.125 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1241245713 12.64.48.125 (Sat, 02 May 2009 06:28:33 GMT) NNTP-Posting-Date: Sat, 02 May 2009 06:28:33 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5650 Date: 2009-05-02T06:28:33+00:00 List-Id: with Ada.Text_IO ; use Ada.Text_IO ; with GNAT.OS_Lib ; -- Could be System.OS_Lib use GNAT.OS_Lib ; procedure test is Program_Name : String := "temp.exe" ; Args : Argument_List_Access ; Success : Boolean ; begin -- test -- Create argument list. Args := Argument_String_To_List ( " First -second 3" ) ; Spawn ( Program_Name, Args.all, Success ) ; if Success then Put_Line ( "Temp was Spawned Correctly" ) ; else Put_Line ( "ERROR: Spawn" ) ; end if ; end test ; -- -- Spawned program. May require open/close calls for checking output -- with Ada.Command_Line ; use Ada.Command_Line ; with Ada.Text_IO ; use Ada.Text_IO ; procedure temp is begin for Index in 1 .. Argument_Count loop Put ( Index'img ) ; Put ( " => " ) ; Put_Line ( Argument ( Index ) ) ; end loop ; end temp ; In <50d832b4-140d-4029-8d7c-9397115160ba@u8g2000yqn.googlegroups.com>, daniel.wengelin@home.se writes: > >Though not an Ada issue, really, someone here might have had the same >problem as I have had: I tried to make a small program start another >program using System.OS_Lib.Spawn. However, it raised Program_Error >and stated Exception_Access_Violation. > >Any ideas why, and what to do about it? > >/D