Like we have some scripts to find eclipse installed location as {workspace_loc}. I've tried with some more syntax but none of them show me a way.
how to find user home path using eclipse command line script in RCPTT?
458 views Asked by Jagadeesh Pulamarasetti At
2
There are 2 answers
1
On
This ECL script below works if your program is started with a workspace in the user's library. It's Windows only; if you need Unix-based solution simply change the "\\" literals to "/" literals.
/* Stores User's home path into global "user_home" if workspace location is within the user folder. */
proc introduce_user_home {
// Splitting up workspace path
let [val splitted [get-workspace-location | split -sep "\\" | to-list]] {
let [val user_part
// Concatenating the part that matters
[concat [$splitted | get 0 | str] // C:
"\\"
[$splitted | get 1 | str] // Users
"\\"
[$splitted | get 2 | str] // Jagadeesh
]] {
get-window $user_part
// Introducing it as a global
global [val "user_home" [$user_part]] -override true
}
}
}
I found myself a way to locate user directory using environment variables
Above code is locating user directory.