Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29832

Re: A "current directory" concept for Java...

From Andreas Leitgeb <avl@auth.logic.tuwien.ac.at>
Newsgroups comp.lang.java.programmer
Subject Re: A "current directory" concept for Java...
Date 2014-08-24 08:42 +0000
Organization A noiseless patient Spider
Message-ID <slrnlvj9aq.fp3.avl@login.logic.tuwien.ac.at> (permalink)
References (1 earlier) <lt85hb$gnk$1@dont-email.me> <slrnlvfl43.fp3.avl@login.logic.tuwien.ac.at> <lta871$22r$1@dont-email.me> <slrnlvhgf8.fp3.avl@login.logic.tuwien.ac.at> <ltaqbk$gnc$1@dont-email.me>

Show all headers | View raw


Martin Gregorie <martin@address-in-sig.invalid> wrote:
>          ProcessBuilder pb = new ProcessBuilder("myprocess", 
>                                                 flist[i].getname());
>          pb.directory(dir);
>          Process p = pb.start();
>          /* deal with process i/o streams */
>          int exitValue = p.waitFor();
>
>                                              Apart from the point that 
> there doesn't seem to be any way to make connections to the new Process's 
> i/o streams before the command it controls starts to execute ...

That's not quite the "whole" truth ;-)
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.

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.

> In a UNIX/Linux environment relative file names are relative to the 
> directory the user is in when a command is issued, but in at least some 
> circumstances Windows programs act as though the 'current directory' is 
> the one the program was loaded from.  I've noticed this difference when 
> running Windows programs on a Linux box under Wine but am unclear when it 
> occurs: might it apply when a program is launched by clicking an icon but 
> not when its launched from a command line or a user-written CMD file?

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.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-22 16:49 +0000
  Re: A "current directory" concept for Java... Jeff Higgins <jeff@invalid.invalid> - 2014-08-22 14:50 -0400
  Re: A "current directory" concept for Java... Jeff Higgins <jeff@invalid.invalid> - 2014-08-22 15:10 -0400
  Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-22 19:26 +0000
    Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-22 23:38 +0000
      Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-23 14:24 +0000
        Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-23 16:31 +0000
          Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-23 19:34 +0000
            Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-24 08:42 +0000
              Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-24 10:37 +0000
                Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-24 13:41 +0000
                Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-24 18:33 +0000
                Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-24 22:33 +0000
                Re: A "current directory" concept for Java... Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-25 00:14 +0000
  Re: A "current directory" concept for Java... Jeff Higgins <jeff@invalid.invalid> - 2014-08-22 19:45 -0400
    Re: A "current directory" concept for Java... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-23 15:32 +0000
      Re: A "current directory" concept for Java... Jeff Higgins <jeff@invalid.invalid> - 2014-08-23 12:49 -0400
      Re: A "current directory" concept for Java... Jeff Higgins <jeff@invalid.invalid> - 2014-08-23 17:40 -0400
  Re: A "current directory" concept for Java... Jan Burse <janburse@fastmail.fm> - 2014-08-23 10:31 +0200
    With new Path (Re: A "current directory" concept for Java...) Jan Burse <janburse@fastmail.fm> - 2014-08-23 10:48 +0200
      Re: With new Path (Re: A "current directory" concept for Java...) Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-08-23 14:38 +0000
  Re: A "current directory" concept for Java... Roedy Green <see_website@mindprod.com.invalid> - 2014-08-23 05:31 -0700

csiph-web