changing working directory?

Discussion in 'Java' started by hack_tick, Oct 24, 2005.

  1. hack_tick

    hack_tick Guest

    hi there!
    I am looking for changing the working directory, using j2se methods is
    it possible?
    hack_tick, Oct 24, 2005
    #1
    1. Advertising

  2. hack_tick

    Roedy Green Guest

    On 24 Oct 2005 00:56:11 -0700, "hack_tick" <>
    wrote, quoted or indirectly quoted someone who said :

    >hi there!
    >I am looking for changing the working directory, using j2se methods is
    >it possible?


    No. Part of the problem is defining what it would mean if thread A
    changed it. What does thread B think?

    What you do instead is define your own default directory, and in the
    simplest case just feed it to File( dir, file) as the first parm.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
    Roedy Green, Oct 24, 2005
    #2
    1. Advertising

  3. hack_tick wrote:

    > I am looking for changing the working directory,


    You're looking for the wrong thing*. Why do you
    think you need that?

    * A 'NetworkClassLoader' (see ClassLoader docs.)
    and a FileDialog or JFileChooser can get at any
    resource in the local file system, permissions granted.
    Andrew Thompson, Oct 24, 2005
    #3
  4. hack_tick

    hack_tick Guest

    m...i was using Runtime.exec i forgot it had overloaded method,

    public Process exec(String[] cmdarray,
    String[] envp,
    File dir)
    throws IOException

    it seems i didnt do my homework :-(

    sorry for any trouble
    hack_tick, Oct 24, 2005
    #4
  5. hack_tick

    hack_tick Guest

    thx a lot, i will keep note of those ;-)
    hack_tick, Oct 24, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    522
    Alvin Bruney
    Nov 30, 2003
  2. Dave Monroe

    Changing Working Directory in Java

    Dave Monroe, Oct 6, 2003, in forum: Java
    Replies:
    6
    Views:
    58,944
    Dave Monroe
    Oct 7, 2003
  3. Priyanka AGARWAL
    Replies:
    9
    Views:
    9,964
    Gordon Beaton
    May 25, 2004
  4. Aaron Beall
    Replies:
    2
    Views:
    1,798
    Aaron Beall
    Sep 14, 2007
  5. VK
    Replies:
    3
    Views:
    175
    Dr J R Stockton
    Mar 15, 2007
Loading...

Share This Page