Programmer's Reference
Following are UNIXEnvironment methods and usage
examples.
- current
- Answers the current environment for Smalltalk. This is equivalent
to typing env at a UNIX shell prompt.
- getenv:
- Gets the environment string association with the specified string.
Answers nil if none. This directly maps to the C function
getenv().
- new
- Answers a new instance of the receiver. The new environment is
empty.
- putenv:
- Adds the specified string (in the form, aKey=aValue) to the current
environment. This directly maps to the C function
putenv().
- startUpEnvironment
- Answers the start-up environment for the user process. This
provides a snapshot of the environment in which Smalltalk is running.
- at:
- Answers the object of the receiver that is associated with an object
equivalent to the specified key. Answers nil if the receiver
does not contain an object equivalent to the key.
- at:ifAbsent:
- Answers the object of the receiver that is associated with an object
equivalent to the specified key. If an equivalent key is not found,
answers the result of evaluating the specified zero argument block.
Returns fail if the key is not found and if the block is not a
zero-argument block.
- at:put:
- Associates the specified key with the specified value, in the
receiver. Answers the value currently associated with aKey
(or nil if absent). If the receiver does not contain the
specified key, it creates a new entry in the receiver for that key.
- envAt:
- Answers the value at the specified key in the receiver in the form
aKey=aValue. If the key is missing, it generates an error.
- envAt:ifAbsent:
- Answers the value at the specified key in the receiver in the form
aKey=aValue. If an equivalent key is not found, answers the result of
evaluating the specified zero argument block.
- envStringAt:ifAbsent:
- Answers the key-value pair in the receiver, indicated by the specified
key. If an equivalent key is not found, answers the result of
evaluating the specified zero argument block.
- keys
- Answers the environment keys in the receiver.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]