From: Per Sandberg <per.s.sandberg@bahnhof.se>
Subject: Re: pass a argument to spawn
Date: Tue, 12 Jan 2016 21:58:11 +0100
Date: 2016-01-12T21:58:11+01:00 [thread overview]
Message-ID: <DNdly.1247925$CU2.940435@fx35.am4> (raw)
In-Reply-To: <21c12d5b-e092-4cf3-b965-55a7003cd9de@googlegroups.com>
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 .
>
>
>
>
>
>
next prev parent reply other threads:[~2016-01-12 20:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 1:17 pass a argument to spawn comicfanzine
2016-01-12 7:05 ` Anh Vo
2016-01-12 7:12 ` Per Sandberg
2016-01-12 13:48 ` comicfanzine
2016-01-12 16:10 ` Björn Lundin
2016-01-12 19:36 ` comicfanzine
2016-01-12 20:58 ` Per Sandberg [this message]
2016-01-17 17:28 ` comicfanzine
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox