Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: A "current directory" concept for Java... Date: Sun, 24 Aug 2014 10:37:56 +0000 (UTC) Organization: A noiseless patient Spider Lines: 52 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 24 Aug 2014 10:37:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="9552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187txen8ONjDP9SX+fscQ8Bo+JCozIJSGQ=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:/jhqGodAXeMpWXdHnlPO3rcilnQ= Xref: csiph.com comp.lang.java.programmer:29834 On Sun, 24 Aug 2014 08:42:02 +0000, Andreas Leitgeb wrote: > That's not quite the "whole" truth ;-) > Quite probably not, so I obviously messed something. > ProcessBuilder has a couple of methods to tell what to do with spawnee's > streams. You can set them up to be redirected to current process's > streams, > cause them to be redirected to files and some more options. > What I was commenting about is that calling ProcessBuilder.start() creates a Process and must start the load and process it controls since there is apparently no Process.start or Process.run method. I was expecting to have either: - a way of redirecting the standard streams provided by ProcessBuilder as well as the redirectErrorStream() switch that would do the job before ProcessBuilder.start is called - the ability to use the Process.getXXXStream() methods before calling a method that would allow the Process to run. Instead, I don't see either of these, so what have I missed? > It's only when you keep it at default, then it is set up for > pipe-streams and what you then do with the created Process is merely > pick up your side of these established streams. > So, you are saying that the Process actually runs for a short time until it either wants input or fills an output buffer and then blocks until the streams have been redirected via the getXXXStream() methods? If so, that seems like a somewhat mickey mouse approach. > Could be a legacy from old Dos-days, where installed programs often > expected to be invoked from their installation directory. Thats when > one had a couple of .bat files for each application, that would cd to > the respective one's installation dir and then start the application. > Agreed. I haven't done much/any programming in the Windows environment since W95, so what is the default these days for command line/scripted execution or for running a program via an icon click? Does the current working directory have the same default in both cases and, if so, can you tell me what it is: this may be useful stuff to know for code portability reasons. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |