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.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PP_MIME_FAKE_ASCII_TEXT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,783da1e5184ba1c9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: system call Date: Mon, 15 Aug 2011 19:37:52 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <4e46c5c3$0$32648$426a74cc@news.free.fr> <2af248fb-c1d4-4f2e-8011-a498c53dfa42@t30g2000prm.googlegroups.com> <6e1fbc7c-6782-4c6b-b605-91669fd2c6e2@j9g2000prj.googlegroups.com> <4e494de0$0$20025$426a34cc@news.free.fr> Reply-To: anon@anon.org NNTP-Posting-Host: yTbBipgI8qE1QdXFk5LTkw.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:21610 Date: 2011-08-15T19:37:52+00:00 List-Id: try something like this with GNAT.OS_Lib; use GNAT.OS_Lib; Prog_File : String_Access ; Arg_File : String_Access ; Args : GNAT.OS_Lib.Argument_List ( 1 .. 1 ); Success : Boolean ; begin Arg_File := new String ( "" ) ; Args ( 1 ) := Arg_File ; Prog_Path := new String ( "" ) ; GNAT.OS_Lib.Spawn (Prog_Path.all, Args, Success); if not Success then Exit_Program (E_Fatal); end if; end ; In <4e494de0$0$20025$426a34cc@news.free.fr>, "philippe.torgue@free.fr" writes: >Adam Beneschan wrote: > >> On Aug 15, 8:40�am, Adam Beneschan wrote: >>> On Aug 13, 11:43�am, "philippe.tor...@free.fr" >>> >>> >>> >>> >>> >>> wrote: >>> > Hello, >>> >>> > I have a program, the time of his execution, constructed images, in fact >>> > files in PPM (P3, plain text mode) >>> > In short, the program does not deal with the viewing of these images >>> > (failing to find a library to do ...) >>> >>> > So I want to entrust this task to an external application (imview, >>> > xview, qiv ... etc): >>> >>> > res = system ("imview out.ppm"); >>> >>> > But each time this code is a new process >>> > image viewer (here imview) that arises. >>> >>> > My application is waiting while I close imview to move to >>> > the next iteration. >>> >>> > Well, now you have guessed the question for each passage on the line above, >>> > I would like the external program (imview, qiv, xview ... whatever), load a new image >>> >>> > Regards! >>> >>> I'm not real clear on what you're trying to do. �But it sounds like >>> you want to run imview or some other program once, and have your >>> program tell that program to display a new image whenever it wants to >>> display something new. �In order for that to work, the image displayer >>> has to be set up to accept that kind of communication. >>> >>> However, if by "imview" you mean the program documented athttp://hugues.zahlt.info/software_imview.html, that program appears to >>> have a server mode. �So you'll need to run it in server mode and then >>> communicate with it via a TCP/IP socket. �The documentation should >>> explain how to do this, but I haven't looked over it carefully. >> >> Oh, yeah, one other thing: if you do this, you won't be able to use >> system("...") to run imview, because "system" will wait for imview to >> finish, which will never happen. You'll need to find a way to spawn >> imview without having your application wait for it to finish. There >> are ways to do this on both Unix/Linux and Windows (you don't say what >> OS you're using); I think there are probably GNAT library operations >> to perform that kind of spawning, but someone who's more knowledgeable >> about GNAT than I am will need to help you with those, if you're using >> GNAT. There's no Ada language-defined operations for this. >> >> -- Adam > >My O.S. is ubuntu. > >Damn! Here's what I read in the documentation imview ( server part) > >"Instead of having a new instance of imview pop up each time one wants >to view an image, they can all appear in one, or a small number of >imview windows. This is great for monitoring progress on a long >processing run, for doing demos, for debugging an image analysis >procedure, etc. >" > >Your idea sounds very good! > > >