Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Proper use of IRemoteConnection.setWorkingDirectory()

Brian,

I would be glad to present my work! Thank you for asking! I'll get in touch with Jay and CC you to set it up.

Thanks for attending my talk. I am glad you enjoyed it.

Thanks,
Jay

-----
Jay Jay Billings
Computational Scientist
Oak Ridge National Laboratory
Twitter Handle: @jayjaybillings

On May 7, 2013 11:24 AM, "Brian Watt" <bwatt@xxxxxxxxxx> wrote:

Hey Jay,

Would you be interested in presenting your work to the PTP user and/or developer community on one of our conference calls? I saw your presentation at EclipseCon and I think it would be good to tell us more about your work. If so, Jay Alameda <jalameda@xxxxxxxxxxxxxxxxx> in our community organizes the calls, and we always looking for good presentations like yours.

Brian Watt, Eclipse PTP Development
(512)286-9169, TL363-9169; FAX: Unknown
IBM Corporation, Div/7T, D/93QA, B/906-5G015, 11501 Burnet Rd, Austin, TX 78758
Notes: Brian Watt/Austin/IBM@IBMUS, EMail: bwatt@xxxxxxxxxx


Inactive hide details for Jay Jay Billings ---05/07/2013 10:12:43 AM---I got it working! The problem was a bug on my side that Jay Jay Billings ---05/07/2013 10:12:43 AM---I got it working! The problem was a bug on my side that was pointing to a path that was not absolute

From: Jay Jay Billings <jayjaybillings@xxxxxxxxx>
To: Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>,
Date: 05/07/2013 10:12 AM
Subject: Re: [ptp-dev] Proper use of IRemoteConnection.setWorkingDirectory()
Sent by: ptp-dev-bounces@xxxxxxxxxxx





I got it working! The problem was a bug on my side that was pointing to a path that was not absolute... but of course I was 100% sure it was absolute. 

Our product logs into a remote machine, creates a time-stamped directory in the user's home directory, moves into that directory and does some work. Here's what I used to set the working directory that works for me (pretty much the same as yours above):

String currentWd = connection.getWorkingDirectory();
connection.setWorkingDirectory(currentWd + connection
.getProperty(IRemoteConnection.FILE_SEPARATOR_PROPERTY) + workingDirectoryName);

The variable "workingDirectoryName" is relative to the working directory set at login, normally /home/user.

Thanks again for your help! Looks like everything is working PTP and I'll be able to eliminate about 1000 lines of code and as many headaches. ;)

Jay


On Sat, May 4, 2013 at 8:47 AM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
    Yes, open the connection first. You might want to check isOpen() to make sure it connected.

    Cheers,
    Greg

    On May 4, 2013, at 8:33 AM, Jay Jay Billings <jayjaybillings@xxxxxxxxx> wrote:

      Greg,

      Thanks. I will try it again. I assume you set the working directory after the connection was opened?

      Jay

      -----
      Jay Jay Billings
      Computational Scientist
      Oak Ridge National Laboratory
      Twitter Handle: @jayjaybillings

      On May 3, 2013 5:05 PM, "Greg Watson" <g.watson@xxxxxxxxxxxx> wrote:

        Jay,

        I just tried:

        connection.setWorkingDirectory("/tmp");
        String wd = connection.getWorkingDirectory();
        System.out.println("wd = " + wd);

        and it prints:

        wd = /tmp

        So I'm not sure what is going wrong. In fact, looking at the code, the only way this would not work is if the path is not absolute.

        Greg

        On May 1, 2013, at 4:36 PM, Jay Jay Billings <
        jayjaybillings@xxxxxxxxx> wrote:

        > Everyone,
        >
        > I am trying to set the working directory of a remote connection by calling IRemoteConnection.setWorkingDirectory(). The JavaDoc says that the path specified needs to be absolute and valid, so I am sending the name of a previously created (~6months back) directory called, for example, /home/jay/scratch. However, calling IRemoteConnection.getWorkingDirectory() always returns the original working directory, in this case /home/jay.
        >
        > My code is essentially the same as:
        >
        > connection.setAddress(host);
        > connection.setUsername(name);
        > connection.setPassword(password);
        > connection.open(null);
        > connection.setWorkingDirectory("/home/jay/scratch");
        >
        > Am I missing something?
        >
        > Thanks for your time!
        >
        > Jay
        >
        > --
        > Jay Jay Billings
        > Oak Ridge National Laboratory
        > Twitter Handle: @jayjaybillings
        > _______________________________________________
        > ptp-dev mailing list
        >
        ptp-dev@xxxxxxxxxxx
        >
        https://dev.eclipse.org/mailman/listinfo/ptp-dev

        _______________________________________________
        ptp-dev mailing list

        ptp-dev@xxxxxxxxxxx
        https://dev.eclipse.org/mailman/listinfo/ptp-dev
      _______________________________________________
      ptp-dev mailing list

      ptp-dev@xxxxxxxxxxx
      https://dev.eclipse.org/mailman/listinfo/ptp-dev



    _______________________________________________
    ptp-dev mailing list

    ptp-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/ptp-dev



--
Jay Jay Billings
Oak Ridge National Laboratory
Twitter Handle: @jayjaybillings_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev

GIF image


Back to the top