I need some helps in running cleartool commands from inside a Java class. Cleartool is an internal command of IBM's Rational ClearCase repository software. The constraint that these commands have is that they should be executed under the mounted drive of ClearCase (in my case, it is under my M: drive). For example, to be able to run the "lshistory" command against foo.java, I should type "cleartool lshistory foo.java" under M: prompt.
I know that I should use the Runtime's exec() method. I've tried the following, but I still don't get what I want.
Theoritically, "inline" should contain the result of lshistory. But, in this instance, inline has a null.
Let's put my problem in a very generic form. Say that I have a class called command.java in which lies a method that will list the contents of a directory (by executing the dos command "dir"). I put this command.java in C: drive. What I'd like this program to do is to list the contents of another drive letter, say D: (D: will always exist). My code below will not let me do it.
Any suggestions? Thanks in advance.
[ November 11, 2005: Message edited by: Miguel Antonioli ] [ November 11, 2005: Message edited by: Miguel Antonioli ]
Joined: Aug 03, 2002
Using the following works for me:
It lists the files on my E: drive. Notice the File object setting the working directory to E:\ [ November 11, 2005: Message edited by: Barry Gaunt ]
Joined: Apr 09, 2005
Barry, thanks a lot. I should have checked the API before I asked