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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!cyclone02.ams2.highwinds-media.com!voer-me.highwinds-media.com!peer02.am1!peering.am1!peer01.fr7!news.highwinds-media.com!post02.fr7!fx35.am4.POSTED!not-for-mail Subject: Re: pass a argument to spawn Newsgroups: comp.lang.ada References: <21c12d5b-e092-4cf3-b965-55a7003cd9de@googlegroups.com> From: Per Sandberg User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <21c12d5b-e092-4cf3-b965-55a7003cd9de@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: X-Complaints-To: abuse@usenet.se NNTP-Posting-Date: Tue, 12 Jan 2016 20:58:11 UTC Organization: usenet.se Date: Tue, 12 Jan 2016 21:58:11 +0100 X-Received-Body-CRC: 1782055700 X-Received-Bytes: 2819 Xref: news.eternal-september.org comp.lang.ada:29110 Date: 2016-01-12T21:58:11+01:00 List-Id: Well From your questions i expect that you want to achieve something like: ---------------------------------------------------------------- with GNAT.Expect; with GNAT.String_Split; with GNAT.OS_Lib; with Ada.Text_IO; use Ada.Text_IO; procedure Console_Ada is Arg : constant GNAT.OS_Lib.Argument_List := (1 => new String'("-a")); Status : aliased Integer := 0; S : GNAT.String_Split.Slice_Set; begin Put_Line ("Print of your files :"); GNAT.String_Split.Create (S => S, From => GNAT.Expect.Get_Command_Output (Command => "/bin/ls", Arguments => Arg, Input => "", Status => Status'Access, Err_To_Out => True), Separators => ASCII.LF & ASCII.CR); for i in 1 .. GNAT.String_Split.Slice_Count (S) loop Put_Line (">> " & GNAT.String_Split.Slice (S, i)); end loop; Put (" Execution of the program with Spawn ? : " & Status'Img); end Console_Ada; ---------------------------------------------------------------- Den 2016-01-12 kl. 20:36, skrev comicfanzine@gmail.com: > Björn , i understand much better . > ----------------- > > I know how to use this procedure : > > procedure Spawn > (Program_Name : String; > Args : Argument_List; > Output_File : String; > Success : out Boolean; > Return_Code : out Integer; > Err_To_Out : Boolean := True); > > His body in the package body is not clear , by the way . > > Anyway , i would like to use an array for storage , instead of : " Output_File : String; " . > > So , maybe it would be simplier to create a spawn procedure with the desired content . > > But , i don't know how to do that . > Informations about spawning in Ada are needed . > > At this mmoment , that's the problem . > > > > > >