From: Shark8 <onewingedshark@gmail.com>
Subject: Re: execute external shell program and process the output line by line
Date: Fri, 18 Oct 2019 07:26:46 -0700 (PDT)
Date: 2019-10-18T07:26:46-07:00 [thread overview]
Message-ID: <3d5a9c8d-87dd-47aa-b481-ec49659ae79f@googlegroups.com> (raw)
In-Reply-To: <69956c86-273a-40c4-b1d8-dc5c7a8e960f@googlegroups.com>
On Thursday, October 17, 2019 at 6:25:28 AM UTC-6, devosa...@gmail.com wrote:
> I need the call a process like "ls",
> And process the output line by line.
> So it is not sufficient if i have the return code success or error.
Aside from the direct-advice others have given, allow me to give some indirect advice: be sure that you really *need* this design.
In my experience, that sort of design is usually from some horribly cobbled-together Unix/Linux system which would be much better fully implemented within your actual Ada program.
A similar thing often happens with medium/large PHP applications, where the standard solution is to use a cron-job to fire periodic scripts, which is wholly unnecessary in Ada because of (a) the presence of timed, cyclic tasks, and (b) the lack of PHP's non-persistence.
In-short, it's best not to cobble together things like you're trying to do if you can avoid doing so: you'll lose a lot of important properties, like types and their constraints.
prev parent reply other threads:[~2019-10-18 14:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 12:25 execute external shell program and process the output line by line devosalain71
2019-10-17 15:34 ` Dennis Lee Bieber
2019-10-18 7:43 ` Simon Wright
2019-10-17 16:17 ` Dmitry A. Kazakov
2019-10-17 20:31 ` Per Sandberg
2019-10-18 14:26 ` Shark8 [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox