manpagez: man pages & more
info bigloo
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7.1 Operating System interface

bigloo procedure: bigloo-config
bigloo procedure: bigloo-config key

The function bigloo-config returns an alist representing the configuration of the running Bigloo system. When used with one parameter, the function bigloo-config returns the value associated with the key.

Examples:

(bigloo-config) ⇒ ((release-number . 3.4b) ... (endianess . little-endian))
(bigloo-config 'endianess) ⇒ little-endian
bigloo procedure: register-exit-function! proc

Register proc as an exit functions. Proc is a procedure accepting of one argument. This argument is the numerical value which is the status of the exit call. The registered functions are called when the execution ends.

bigloo procedure: exit int

Apply all the registered exit functions then stops an execution, returning the integer int.

bigloo procedure: signal n proc

Provides a signal handler for the operating system dependent signal n. proc is a procedure of one argument.

bigloo procedure: get-signal-handler n

Returns the current handler associated with signal n or #f if no handler is installed.

bigloo procedure: system . strings

Append all the arguments strings and invoke the native host system command on that new string which returns an integer.

bigloo procedure: system->string . strings

Append all the arguments strings and invoke the native host system command on that new string. If the command completes, system->string returns a string made of the output of the command.

bigloo procedure: getenv string

Returns the string value of the Unix shell’s string variable. If no such variable is bound, getenv returns #f.

bigloo procedure: putenv string val

Adds or modifies the global environment variable string so that it is bound to val after the call. This facility is not supported by all back-end. In particular, the JVM back-end does not support it.

bigloo procedure: date

Returns the current date in a string. See also Date.

bigloo procedure: sleep micros

Sleeps for a delay during at least micros microseconds.

bigloo procedure: command-line

Returns a list of strings which are the Unix command line arguments.

bigloo procedure: executable-name

Returns the name of the running executable.

bigloo procedure: os-class

Gives the OS class (e.g. ‘unix’).

bigloo procedure: os-name

Gives the OS name (e.g. ‘Linux’).

bigloo procedure: os-arch

Gives the host architecture (e.g. ‘i386’).

bigloo procedure: os-version

Gives the operating system version (e.g. ‘RedHat 2.0.27’).

bigloo procedure: os-tmp

Gives the regular temporary directory (e.g. ‘/tmp’).

bigloo procedure: os-charset

Gives the charset used for encoding names of the file system (e.g. ‘UTF-8’).

bigloo procedure: file-separator

Gives the operating system file separator (e.g. ‘#\/’).

bigloo procedure: path-separator

Gives the operating system file path separator (e.g.‘#\:’).

For additional functions (such as directory->list) see Input and output.

bigloo procedure: unix-path->list

Converts a Unix path to a Bigloo list of strings.

(unix-path->list ".")           ⇒ (".")
(unix-path->list ".:/usr/bin")  ⇒ ("." "/usr/bin")
bigloo procedure: hostname

Returns the fully qualified name of the current host.

bigloo procedure: time thunk

Evaluates the thunk and returns four values: the result of calling thunk, the actual execution time, the system time, and the user time in millisecond.

(multiple-value-bind (res rtime stime utime)
  (time (lambda () (fib 35)))
  (print "real: " rtime " sys: " stime " user: " utime))
bigloo procedure: getuid
bigloo procedure: getgid
bigloo procedure: setuid uid
bigloo procedure: setgid uid

The procedure getuid (resp. getgid) returns the UID (resp. GID) of the user the current process is executed on behalf of.

The procedure setuid (resp. setgid) set the UID (resp. GID) of the current process. In case of failure, this procedure raises an error.

bigloo procedure: getpwnam name
bigloo procedure: getpwuid uid

These two procedures returns information about a user. The procedure getpwname accepts a string denoting the user name as argument. The procedure getpwuid accepts an UID as returned by the procedure getuid.

If the user is found, these two procedures returns a list of seven elements:

  • the user name,
  • his encrypted password,
  • his uid,
  • his group id,
  • his real name,
  • his home directory,
  • his preferred shell.

When no user is found, these procedures returns #f.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 31, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.