Source directory, current directory, home directory, temporary directory …
/" (Unix) or "\" (Windows)
C:"
C:\"PATH is the sequence of directories (folders) to traverse to arrive at the storage location of a file
Each directory (folder) gets separated with the letter "/" (Unix) or "\" (Windows)
Windows examples for absolute (starts with the root directory/folder) and relative paths
C:\Users\JohnDoe\Documents\someFile1.png (absolute path)
Documents\someFile2.png (relative path: relative to current directory/folder)
Unix examples for absolute and relative paths
/Users/MaryDoe/Documents/someFile1.png (absolute path)
Documents/someFile2.png (relative path: relative to current directory/folder)
Can be retrieved from Rexx using the PARSE SOURCE keyword statement
opsys refers to the operating system, e.g. "Windows", "Darwin" (Apple), "Linux", …
invocationType is one of "COMMAND", "FUNCTION", "SUBROUTINE", "METHOD", "REQUIRES"
pathToRexxProgram is the fully qualified path to the Rexx program, e.g.
C:\Users\JohnDoe\programs\someProgram.rex (absolute path, Windows)
/Users/MaryDoe/programs/someProgram.rex (absolute path, Unix)
FILESPEC()-BIF (built-in-function) allows to retrieve different parts of a path
e.g. FILESPEC('location', pathToRexxProgram) yields for the above two examples:
C:\Users\JohnDoe\programs\ (Windows example location)
/Users/MaryDoe/programs/ (Unix example location)
directory(optionalNewDir)-BIF (built-in-function)
optionalNewDir supplied, changes the current directory to itOutput Windows, assuming current directory is
C:\Users\MaryDoe\temp:
Output Unix, assuming current directory is
/Users/JohnDoe/temp:
C:\Users\MaryDoe\temp
C:\Users\MaryDoe
/Users/JohnDoe/temp
/Users/JohnDoe
USERPROFILE"HOME"value()-BIF (built-in-function) to retrieve the environment variable's value, e.g.
Windows: defined with the environment variable "TMP" or "TEMP"
MacOS: defined with the environment variable "TMPDIR"
Unix: usually the directory "/tmp"
java.util.System class manages the properties for the system
| Directory | Name of System Property |
|---|---|
| Current directory | "user.dir" |
| Home directory | "user.home" |
| Temporary directory | "java.io.tmpdir" |
say "User name :" .java.lang.System~getProperty("user.name")
say "User's home directory:" .java.lang.System~getProperty("user.home")
say "Current directory :" .java.lang.System~getProperty("user.dir")
say "Temp directory :" .java.lang.System~getProperty("java.io.tmpdir")
::requires BSF.CLS -- get ooRexx-Java bridge
Possible output (Windows) assuming current directory is C:\Program Files\ooRexx:
User name : JohnDoe
User's home directory: C:\Users\JohnDoe
Current directory : C:\Program Files\ooRexx
Temp directory : C:\Users\JohnDoe\AppData\Local\Temp\
WU
Prof. Mag. Dr. Rony G. Flatscher
Welthandelsplatz 1
1020 Wien/Vienna
Austria/Europe
www: www.wu.ac.at