Next: Processes, Previous: Android view construction, Up: Miscellaneous topics [Contents][Index]
A string containing the home directory of the user.
Returns a nonempty list of immutable strings. The first element is
an implementation-specific name for the running top-level
program.
The remaining elements are the command-line arguments,
as passed to the main
method (except for those
flags processed by Kawa itself).
The first element will depend on how the Kawa module was invoked. Kawa uses the following rules to determine the command name:
kawa.command.name
is set, that is used.
This variable can be set on the kawa
command line,
for example from a script:
kawa -Dkawa.command.name="$0" foo "$@"
This variable is also set implicitly by the meta-arg option. FIXME.
kawa.command.line
is set,
then we use that (after stripping off text that duplicates
the remaining arguments).
The kawa
program sets this property to the
command line used to invoke it
(specifically the contents of the entire argv
array),
before invoking the java
program.
sun.java.command
is set,
then we use that (after stripping off text that duplicates
the remaining arguments), and then prepending the string "java "
.
The OpenJDK java
program sets this property.
"kawa"
.
Any command-line arguments (following flags processed by Kawa itself) are assigned to the global variable ‘command-line-arguments’, which is a vector of strings.
Process any initial command-line options that set variables.
These have the form name=value
.
Any such command-line options (at the start of the command-line)
are processed and removed from the command-line.
$ java kawa.repl -- abc=123 def #|kawa:1|# (write (command-line)) ("java kawa.repl --" "abc=123" "def") #|kawa:2|# (process-command-line-assignments) #|kawa:3|# (write (command-line)) ("java kawa.repl -- abc=123" "def") #|kawa:4|# abc 123
This function is mostly useful for Kawa applications
compiled with the --main
option.
(It is used to set XQuery external
variables.)
Many operating systems provide each running process with
an environment conisting of environment variables.
(This environment is not to be confused with the
Scheme environments that can be passed to eval
.)
Both the name and value of an environment variable are
strings. The procedure get-environment-variable
returns the value of the environment variable name,
or #f
if the environment variable is not found.
(This uses the java.lang.System:getenv
method.)
It is an error to mutate the resulting string.
(get-environment-variable "PATH") ⇒ "/usr/local/bin:/usr/bin:/bin"
Returns the names and values of all the environment variables as an alist, where the car of each entry is the name of an environment variable, and the cdr is its value, both as strings. It is an error to mutate any of the strings or the alist itself.
(get-environment-variables) ⇒ (("USER" . "root") ("HOME" . "/"))
Next: Processes, Previous: Android view construction, Up: Miscellaneous topics [Contents][Index]