index Zimbu documentation

MODULE SYS @directory

summary

     

Various system related stuff

Still very much under development.

CLASS  E_Process @public  Exception thrown for an error related to a Process.
CLASS  Process @public  Class for handling processes.
BITS  IOFlags @public  Flags to pass to Process.setIO().
ENUM  Signal @public  Signals that can be received and send to a Process.
 
shell(command) int @public  Execute command with the shell.
shellBackground(command) int @public  Execute command with the shell in the background.
getEnv(name) string @public  Get the value of environment variable name.
openInBrowser(page) status @public  Open web address page in a browser.
 

members (alphabetically)

     

FUNC getEnv(string name) string @public

     

Get the value of environment variable name.

If name does not exist NIL is returned.

FUNC openInBrowser(string page) status @public

     

Open web address page in a browser.

page should be the full path, such as "http://www.zimbu.org". Or "file:///tmp/loveletter.pdf". For ZWT you need to use something like "http://localhost:8884/".

Does not wait for the browser to finish, uses SYS.shellBackground().

Uses $BROWSER when it is set.

Otherwise, on Mac OS the "open URL" command is used. On MS-Windows the default browser is used. On other systems the following commands are tried: "google-chrome", "firefox", "safari", "opera" and "ie". The first one that can be found in $PATH is used. When none is found or execution fails then FAIL is returned.

FUNC shell(string command) int @public

     

Execute command with the shell.

Just like the C library system() function.

Returns the exit code, usually zero for success. Returns -1 if the shell could not be executed.

FUNC shellBackground(string command) int @public

     

Execute command with the shell in the background.

Like shell(), but does not wait for the command to finish.

Returns -1 if the shell could not be executed.

license

      Copyright 2010 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0