namespace Sys

The main system namespace, it provides a abstract and standard system interface

namespace attributes [NB. highlighted items are covered in other pages - namespaces or classes]
namespace env - Provides access to the enviroment the script runs in
class TcpStream - Provides a tcp stream implementation of the standard stream object
class UnixStream - Provides a Unix domain socket implementation of the Stream object
variable O_RDONLY - Flag to set the file as read only upon open
variable O_WRONLY - Flag to set the file as write only upon open
variable O_RDWR - Flag to set the file as read and write upon open
variable O_CREAT - Flag to create the file upon opening if it does not exist
variable O_EXCL - Make sure that the file is exclusive
variable O_TRUNC - Open the file and trucate it to 0 length
variable O_APPEND - Cause writes to be append to the end of the file
variable LOG_PID - Include process ID with log messages
variable LOG_CONS - Log to the system console if unable to write to syslog
variable LOG_NDELAY - Open the syslog connection immediately
variable LOG_PERROR - Log to stderr as well as to the system log
variable LOG_KERN - Kernel log facility
variable LOG_USER - User level log facility
variable LOG_MAIL - Mail system log facility
variable LOG_DAEMON - Daemon log facility
variable LOG_SYSLOG - Internal Syslog log facility
variable LOG_LPR - Line printer subsystem log facility
variable LOG_NEWS - News server log facility
variable LOG_UUCP - UUCP subsystem log facility
variable LOG_CRON - Cron daemon log facility
variable LOG_AUTHPRIV - Authorisation/security log facility
variable LOG_FTP - FTP server log facility
variable LOG_LOCAL0 - Local log facility 0
variable SIGHUP - Hang Up signal
variable SIGINT - Interrupt signal
variable SIGQUIT - Quit signal
variable SIGILL - Illegal Instruction signal
variable SIGTRAP - Trap signal (used for breakpoints)
variable SIGABRT - Abort signal
variable SIGBUS - Bus error signal
variable SIGFPE - Floating Point Exception signal
variable SIGKILL - Kill signal
variable SIGUSR1 - User defined signal 1
variable SIGSEGV - Segmentation Fault signal
variable SIGUSR2 - User defined signal 2
variable SIGPIPE - Broken Pipe signal
variable SIGALRM - Alarm signal
variable SIGTERM - Terminate signal
variable SIGSTKFLT - Stack fault signal
variable SIGCHLD - Child terminated signal
variable SIGCONT - Continue signal
variable SIGSTOP - Stop signal
variable SIGTSTP - Terminal stop signal
variable SIGTTIN - Terminal input without a controlling terminal signal
variable SIGTTOU - Terminal output without a controlling terminal signal
variable SIGURG - Urgent data on a socket signal
variable SIGXCPU - CPU time limit exceeded signal
variable SIGXFSZ - File size limit exceeded signal
variable SIGVTALRM - Virtual alarm clock signal
variable SIGPROF - Profiling timer signal
variable SIGWINCH - Window size change signal
variable SIGIO - I/O now possible signal
variable PRIO_PROCESS - Get/set the priority of a process
variable PRIO_PGRP - Get/set the priority of a process group
variable PRIO_USER - Get/set the priority of a user
variable RLIMIT_CPU - Resource limit on CPU time in seconds
variable RLIMIT_DATA - Resource limit on size of data segment
variable RLIMIT_FSIZE - Resource limit on file size
variable RLIMIT_LOCKS - Resource limit on number of file locks
variable RLIMIT_MEMLOCK - Resource limit on number of bytes of memory to lock into RAM
variable RLIMIT_NOFILE - Resource limit on number of open files
variable RLIMIT_NPROC - Resource limit on number of processes current UID can have
variable RLIMIT_RSS - Resource limit on maximum RSS size in pages
variable RLIMIT_STACK - Resource limit on maximum stack size in bytes
variable RLIM_INFINITY - Special resource limit value which means "no limit"
function access() - Tests the accessibility of the specified path
function umask() - sets the umask to mask & 0777
function mkfifo() - creates a FIFO special file
function openfile() - Open a system file using the flags specified
function createfile() - Create a disk file with the specified modes
function opendir() - Reads all the file names in a directory into a StringStream
function openprocess() - Open a process for communication using pipes
function mkdir() - Create a directory with the given modes
function remove() - Delete a name and possibly the file it refers to
function move() - Move an item from one location to another
function hardlink() - Create a hardlink from one location to another
function softlink() - Create a hardlink from one location to another
function getcwd() - Get the current working directory
function chdir() - Change the current working directory to the path specified
function chroot() - Changes the root directory to the specified path
function chmod() - Changes the permission bits of the specified file
function chown() - Changes the owner and/or the group ID of the specified file
function utime() - Sets the access and modification times of the specified file
function stat() - Gather information about a specified file
function lstat() - Gather information about a specified file
class Stat - Provides functions to interrogate the information returned after a Sys.stat or Sys.lstat call
class Uname - This class provides various system information
class Pipe - This class provides a means for talking to a forked child process
class ProcessStream - This class provides a means for reading or writing to another process
class Dir - This class provides a means for listing the files in a directory
class FileStream - This class provides a means for accessing a file for reading or writing
function Time() - Get the current time as a long
class Tm - Provides a time object with which information can be gathered
function gmtime() - Convert a long representation of time to an object
function localtime() - Convert a long representation expressed relative to the specified timezone
function strptime() - Convert a string based upon a given format to a Tm object
function timezone() - Get the seconds West of GMT
class Alarm - Provide a means for setting an alarm
function fork() - Causes the process to fork a child
function waitpid() - Waits for a child process to terminate
function getuid() - Get the real user id of the running process
function geteuid() - Get the effective user id of the running process
function setuid() - Sets the effective user ID
function getgid() - Get the real group id of the running process
function getegid() - Get the effective group id of the running process
function setgid() - Sets the effective group ID
function uidInfo() - Get a Sys.User object with the information about the user
class User - Class to wrap the information about a user
function getpid() - Get the process ID of the running process
function getppid() - Get the process ID of the parent of the running process
function setsid() - Creates a new session
function kill() - sends the specified signal to the specified process(es)
function registerSigHandler() - registers the specified function as a signal handler
function resetSigAction() - Resets the specified signal to the default action
function ignoreSignal() - Causes the specified signal to be ignored
function getpriority() - Get the scheduling priority
function setpriority() - Set the scheduling priority
class Rusage - Get the resource usage of this process or all dead child processes
class Rlimit - Allows you to get and set resource limits
function openlog() - Open a connection to syslog facility
class SyslogStream - This is Stream returned by Sys.openlog( ). Do not create instances of this class directly.
variable SEEK_SET - The offset is set to offset bytes from the begining of the stream
variable SEEK_CUR - The offset is set to current location plus offset bytes
variable SEEK_END - The offset is set to the size of the file plus offset bytes
variable Endofline - The end of line delimeter
function gc() - Force the garbage collector to be invoked
function warning() - Cause ferite to issue an non-fatal warning
function error() - Cause ferite to throw an exception
function strerror() - Convert an error return into a string
function exit() - Cause the script to cease executing and set the return value
function scriptName() - Get the name of the executing script
function getVersion() - Get the version of the engine
function system() - Execute a command and wait for it to return
function sleep() - Suspend execution for the specified number of seconds
function usleep() - Suspend execution for microsecond intervals
function timestamp() - Generate a double representing a timestamp including microseconds
class Stream - Provides the mechanism for stream objects - it has a number of methods for use
class StdioStream - Provides a standard io interface to a native OS stream. Use Sys.stdin(), Sys.stdout(), or Sys.stderr() to obtain objects of this type. Other functions are likely to return instances.
class StringStream - Provides a way to access a string as if it were a stream
function stdin() - Get the stdin system stream for reading
function stdout() - Get the stdout system stream for writing
function stderr() - Get the stderr system stream for writing errors out to

Functions

function access Click to go up to the list
Tests the accessibility of the specified path
Declaration:
    native function access(string pathname, string modes)
Description:
Use this function to check if the current process is allowed to read, write to, or execute the specified path, or merely to check for its existance. Which tests to perform is controlled by the modes string, which is a list of one or more of the following letters: r = test for read access; w = test for write access; x = test for execute access; f = test for existance. Any other letters in the mode string are ignored. On success (ie. all of the tests passed), true is returned. On failure of at least one of the tests, false is returned.
Parameters:
    Parameter #1: string pathname - The location of the file or directory to test
    Parameter #2: string modes - The list of different access modes to test for
Returns:
    true if all the tests passed, false if any of them failed

function umask Click to go up to the list
sets the umask to mask & 0777
Declaration:
    native function umask(number mask)
Description:
This function sets the umask and returns the old value. The umask value is used when calculating the file permissions which are used when creating a new file.
Parameters:
    Parameter #1: number mask - The value to set the umask to
Returns:
    The previous umask value

function mkfifo Click to go up to the list
creates a FIFO special file
Declaration:
    native function mkfifo(string filename, number mode)
Description:
This function creates a kind of special file called a FIFO, which is commonly used for inter-process communication. The mode argument is an ordinary octal file permissions map (eg. 0666).
Parameters:
    Parameter #1: string filename - The name of the FIFO to create
    Parameter #2: number mode - The file permissions to give the FIFO
Returns:
    True on success or false on failure

function openfile Click to go up to the list
Open a system file using the flags specified
Declaration:
    native function openfile( string filename, number flags )
Description:
This is the method of opening a file in ferite. Use the O_ variables in the Sys module to create the flags to pass. It will return a FileStream object which will allow for clean interaction of the file, please see FileStream for more information. To open a file for reading you simply have to do:

object file = Sys.openfile( "path/to/file.txt", Sys.O_RDONLY );
Parameters:
    Parameter #1: string filename - The file to open
    Parameter #2: number flags - Bit and'd flags
Returns:
    A FileStream object on success, null otherwise

function createfile Click to go up to the list
Create a disk file with the specified modes
Declaration:
    native function createfile( string filename, number mode )
Description:
This method will overwrite any existing file. The modes are in the form of an octal number eg. 0644 - This has three parts, the 6 and two 4's. The first dictates the access modes for the owner, the second the access modes for the group, and the third, the access modes for everyone else. In the case of 0644, it'll allow read/write for the owner, and read only for everyone else. This is the most common mode. If an object is returned, it'll be a FileStream object with the ability to write to.
Parameters:
    Parameter #1: string filename - The name of the file to create
    Parameter #2: number mode - The modes to use in an octal form
Returns:
    A FileStream object on success, null otherwise

function opendir Click to go up to the list
Reads all the file names in a directory into a StringStream
Declaration:
    native function opendir(string path)
Description:
Prior to Ferite 0.99.6 Sys.opendir() read all the file names in a directory into a newline delimited string in one go and then created a DirStream object from it. The old DirStream object was actually not a directory stream at all but a pseudo-stream which provided a way to read from a string using readln() etc. A real directory stream class (Sys.Dir) has new been implemented, but the old opendir() has been kept as well for reasons of backwards compatibility. It returns an instance of the StringStream class, which is similar to the old DirStream class in that it allows you to read from a string using the readln() method (among other things).
Parameters:
    Parameter #1: string path - The directory to read the file names from
Returns:
    A StringStream object on success, null otherwise

function openprocess Click to go up to the list
Open a process for communication using pipes
Declaration:
    native function openprocess( string cmd, string modes )
Description:
This allows for one way communication with another process, either the ability to read the process's output, or write to it's input. The modes are either "r" for reading or "w" for writing.
Parameters:
    Parameter #1: string cmd - The command to execute
    Parameter #2: mstring modes - The modes to use
Returns:
    A ProcessStream object on success, null otherwise

function mkdir Click to go up to the list
Create a directory with the given modes
Declaration:
    native function mkdir( string dirname, number mode )
Description:
This creates a directory using the octal modes supplied like Sys.createfile
Parameters:
    Parameter #1: string dir - The name of the directory to create
    Parameter #2: number mode - The modes to create it with
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function remove Click to go up to the list
Delete a name and possibly the file it refers to
Declaration:
    native function remove( string filename )
Parameters:
    Parameter #1: string filename - The name to delete
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function move Click to go up to the list
Move an item from one location to another
Declaration:
    native function move( string oldpath, string newpath )
Parameters:
    Parameter #1: string oldpath - The current location
    Parameter #2: string newpath - The new location
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function hardlink Click to go up to the list
Create a hardlink from one location to another
Declaration:
    native function hardlink( string oldpath, string newpath )
Description:
This is equivelent to the ln command used with just the two arguments
Parameters:
    Parameter #1: string oldpath - The current location
    Parameter #2: string newpath - The place to create the hardlink
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function softlink Click to go up to the list
Create a hardlink from one location to another
Declaration:
    native function softlink( string oldpath, string newpath )
Description:
This is equivalent to the ln command passed with the flag '-s' and used with the two arguments
Parameters:
    Parameter #1: string oldpath - The current location
    Parameter #2: string newpath - The place to create the softlink
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function getcwd Click to go up to the list
Get the current working directory
Declaration:
    native function getcwd( )
Returns:
    The current working directory as a string

function chdir Click to go up to the list
Change the current working directory to the path specified
Declaration:
    native function chdir( string path )
Parameters:
    Parameter #1: string path - The path to change to
Returns:
    'true' on success, 'false' otherwise and err.str will be set with the error

function chroot Click to go up to the list
Changes the root directory to the specified path
Declaration:
    native function chroot(string path)
Description:
This function changes the root directory of the current process to the specified path. Note that you must be root in order to call this function, it does not automatically change the working directory to the new root directory, and that the root user can easily break out of the new root. If you are doing the chroot for security reasons, it is usual to setuid() to a different user straight after the chroot() in order to make it much harder to escape from the chroot jail. Returns false if the call fails.
Parameters:
    Parameter #1: string path - The path to change the root directory to
Returns:
    True on success and false on failure

function chmod Click to go up to the list
Changes the permission bits of the specified file
Declaration:
    native function chmod(string filename, number mode)
Description:
This function attempts to change the permission flags of the specified file to the specified value. If the file is a symbolic link, it changes the permissions of the file the link points to rather than the link itself. On failure, false is returned and err.str is set. The permissions flags are typically specified as a three digit octal number (eg. 0666).
Parameters:
    Parameter #1: string filename - The name of the file to change the permissions of
    Parameter #2: number mode - The permission bits to give the file
Returns:
    True on success and false on failure

function chown Click to go up to the list
Changes the owner and/or the group ID of the specified file
Declaration:
    native function chown(string filename, number uid, number gid)
Description:
This function attempts to change the owner and/or the group of the specified file. Only root can change the owner of a file, but the owner of a file can change its group to any group of which they are a member. If -1 is specified for either the user ID or the group ID, chown does not attempt to change that parameter. If the call fails, it returns false and sets err.str.
Parameters:
    Parameter #1: string filename - The name of the file to change the owner/group of
    Parameter #2: number uid - The ID of the new owner of the file or -1
    Parameter #3: number gid - The ID of the new group of the file or -1
Returns:
    True on success and false on failure

function utime Click to go up to the list
Sets the access and modification times of the specified file
Declaration:
    native function utime(string filename, number atime, number mtime)
Description:
This function attempts to set the last access time and the last modification time of the specified file. The times are in standard Unix format (ie. the number of seconds since 00:00 on the 1st January 1970). If the atime and mtime parameters are omitted, the access and modification times are set to the current system time.
Parameters:
    Parameter #1: string filename - The name of the file to change the times of
    Parameter #2: number atime - The last access time of the file
    Parameter #3: number mtime - The last change time of the file
Returns:
    True on success and false on failure

function stat Click to go up to the list
Gather information about a specified file
Declaration:
    native function stat( string filename )
Parameters:
    Parameter #1: string filename - The filename to look at
Returns:
    Returns a Sys.Stat object on success, null otherwise

function lstat Click to go up to the list
Gather information about a specified file
Declaration:
    native function lstat( string filename )
Description:
Almost identical to Sys.stat except for the fact that, if the file being pointed to by filename happens to be a symlink, the information about the symlink will be returned, unlike the file the link points to in the case of Sys.stat().
Parameters:
    Parameter #1: string filename - The filename to look at
Returns:
    Returns a Sys.Stat object on success, null otherwise

function Time Click to go up to the list
Get the current time as a long
Declaration:
    native function Time( )
Returns:
    The time represented as a long

function gmtime Click to go up to the list
Convert a long representation of time to an object
Declaration:
    native function gmtime( number time )
Parameters:
    Parameter #1: number time - The time to use - this can be obtained from Sys.Time()
Returns:
    A Sys.Tm object on success, null otherwise

function localtime Click to go up to the list
Convert a long representation expressed relative to the specified timezone
Declaration:
    native function localtime( number timestamp )
Description:
This takes note of daylight saving and other locale specific issues. It assumes that the time is in UTC and takes into accout the timezone the environment is in.
Parameters:
    Parameter #1: number timestamp - The time to convert
Returns:
    A Sys.Tm object on success, null otherwise

function strptime Click to go up to the list
Convert a string based upon a given format to a Tm object
Declaration:
    native function strptime( string str, string fmt )
Parameters:
    Parameter #1: string str - The string to convert
    Parameter #2: string fmt - The format of the string - see Sys.Tm.strftime for codes
Returns:
    A Sys.Tm object on success, null otherwise

function timezone Click to go up to the list
Get the seconds West of GMT
Declaration:
    native function timezone( )
Returns:
    The number of seconds

function fork Click to go up to the list
Causes the process to fork a child
Declaration:
    native function fork( )
Description:
Forks a child process from the current running process. If the fork succeeds it returns the PID of the child process (always a non-zero positive integer) to the parent and 0 to the child. If the fork fails, it returns -1 to the parent.

function waitpid Click to go up to the list
Waits for a child process to terminate
Declaration:
    native function waitpid( )
Description:
If you fork child processes, when they exit you must reap them by calling waitpid() or they will stay in the process table in the zombie state. You can call waitpid() with a specific PID and it will wait for that process to terminate, or you can call it with the value 0 and it will wait for any child processes to terminate. If the nohang argument is set to "true", waitpid() will return immediately even if there are no children waiting to be reaped. If an error occurs, -1 is returned.
Parameters:
    Parameter #1: number pid - The ID of the process to wait for or 0 to wait for any child process
    Parameter #2: number nohang - Forces waitpid() to return immediately if set to true
Returns:
    The PID of the process which terminated or 0 if nohang was true and there were no children waiting to be reaped

function getuid Click to go up to the list
Get the real user id of the running process
Declaration:
    native function getuid( )
Returns:
    The real user id

function geteuid Click to go up to the list
Get the effective user id of the running process
Declaration:
    native function geteuid( )
Returns:
    The effective user id

function setuid Click to go up to the list
Sets the effective user ID
Declaration:
    native function setuid(number uid)
Description:
This function attempts to set the effective user ID to the specified value. If called by root, it also sets the real and saved IDs, allowing root processes to become an ordinary user in a way that prevents them from returning to the root ID later. Returns false and sets err.str on failure.
Parameters:
    Parameter #1: number uid - The ID to set the effective UID to
Returns:
    true on success or false on failure

function getgid Click to go up to the list
Get the real group id of the running process
Declaration:
    native function getgid( )
Returns:
    The real group id

function getegid Click to go up to the list
Get the effective group id of the running process
Declaration:
    native function getegid( )
Returns:
    The effective group id

function setgid Click to go up to the list
Sets the effective group ID
Declaration:
    native function setgid(number gid)
Description:
This function attempts to set the effective group ID to the specified value. If called by root, it also sets the real and saved IDs, allowing root processes to become an ordinary user in a way that prevents them from returning to the root ID later. Returns false and sets err.str on failure.
Parameters:
    Parameter #1: number gid - The ID to set the effective GID to
Returns:
    true on success or false on failure

function uidInfo Click to go up to the list
Get a Sys.User object with the information about the user
Declaration:
    function uidInfo( number uid )
Parameters:
    Parameter #1: number uid - The user id - can be obtained using Sys.getuid()
Returns:
    A user object

function getpid Click to go up to the list
Get the process ID of the running process
Declaration:
    native function getpid()
Returns:
    The process ID

function getppid Click to go up to the list
Get the process ID of the parent of the running process
Declaration:
    native function getppid()
Returns:
    The process ID of the parent

function setsid Click to go up to the list
Creates a new session
Declaration:
    native function setsid()
Description:
This function attempts to create a new session and a new process group, and makes the caller the leader of the process group. It also detaches the caller from any controlling TTYs. On error, -1 is returned and err.str is set.
Returns:
    The ID of the new session or -1 on error

function kill Click to go up to the list
sends the specified signal to the specified process(es)
Declaration:
    native function kill(number pid, number sig)
Description:
This function sends the specified signal to the specified process ID, or to every process except init if pid is -1, or if pid is less than -1 to every process in the process group -pid (if it exists). The values for sig are available as constants in the Sys class beginning with SIG. Returns false and sets err.str on failure.
Parameters:
    Parameter #1: number pid - the ID to send the signal to
    Parameter #2: number sig - the number of the signal to senda
Returns:
    true on success or false on failure

function registerSigHandler Click to go up to the list
registers the specified function as a signal handler
Declaration:
    native function registerSigHandler(number sig, string func, object o)
Description:
This function registers the specified function as a signal handler. The signal handler must have the prototype function handler(number sig, object o). It will be passed the number of the signal and the object which was specified in the call to registerSighandler(). If the signal already had a handler, it will be replaced by the new one. Returns true on success or false on failure.
Parameters:
    Parameter #1: number sign - The signal number to handle
    Parameter #2: string func - The name of the handler function
    Parameter #3: object o - An object to pass to the handler (may be null)
Returns:
    true on success or false on failure

function resetSigAction Click to go up to the list
Resets the specified signal to the default action
Declaration:
    native function resetSigAction(number sig)
Description:
This function resets the action of the specified signal to the OS default (typically it will either be ignored or cause the process to be killed).
Parameters:
    Parameter #1: number sig - The number of the signal to reset the action of
Returns:
    true on success or false on failure

function ignoreSignal Click to go up to the list
Causes the specified signal to be ignored
Declaration:
    native function ignoreSignal(number sig)
Description:
Many signals have a default action which causes the process to exit. This function will cause the specified signal to be ignored instead. It can also be used to unregister a signal handler function.
Parameters:
    Parameter #1: number sig - The number of the signal to ignore
Returns:
    true on success or false on failure

function getpriority Click to go up to the list
Get the scheduling priority
Declaration:
    native function getpriority(number which, number who)
Description:
This function returns the scheduler priority of the specified process, process group, or user (set the which argument to Sys.PRIO_PROCESS, Sys.PRIO_PGRP, or Sys.PRIO_USER to choose which one). The who argument can be either the ID of the specified process, process group or user, or it can be 0 which is taken to mean the calling process, the process group of the calling process, or the real user ID of the calling process. The return value is typically in the range -20 to 19 (lower numbers are a higher priority). Because -1 is a valid return value, the only way to tell if an error occured is to check the value of err.num if the return value is -1. It will be 0 if no error occured (ie. the priority really is -1), and a number greater than 0 if an error occured. When requesting the priority of a process group, the highest priority in the group will be returned.
Parameters:
    Parameter #1: number which - Sys.PRIO_PROCESS, Sys.PRIO_PGRP, or Sys.PRIO_USER
    Parameter #2: number who - Process ID, process group ID, or user ID
Returns:
    The requested priority

function setpriority Click to go up to the list
Set the scheduling priority
Declaration:
    native function setpriority(number which, number who, number prio)
Description:
This function attempts to set the scheduler priority of the specified process, process group, or user (set the which argument to Sys.PRIO_PROCESS, Sys.PRIO_PGRP, or Sys.PRIO_USER to choose which one). The who argument can be either the ID of the specified process, process group or user, or it can be 0 which is taken to mean the calling process, the process group of the calling process, or the real user ID of the calling process. The priority is an integer typically in the range -20 to 19, with lower numbers being higher priority. The default priority is 0. Note than only root is allowed to set priorities higher than 0. Returns false and sets err.str on failure.
Parameters:
    Parameter #1: number which - Sys.PRIO_PROCESS, Sys.PRIO_PGRP, or Sys.PRIO_USER
    Parameter #2: number who - Process ID, process group ID, or user ID
    Parameter #3: number prio - The priority to set
Returns:
    True on success or false on failure

function openlog Click to go up to the list
Open a connection to syslog facility
Declaration:
    native function openlog( string ident, number option, number facility )
Parameters:
    Parameter #1: string ident - String that will be added to each message, usually the program name
    Parameter #2: number option - Options is an OR of the following: Sys.LOG_CONS, Sys.LOG_PID, Sys.LOG_NDELAY, Sys.LOG_PERROR
    Parameter #3: number facility - Describes what facility is logging. It can be any one of: Sys.LOG_KERN, Sys.LOG_USER, Sys.LOG_MAIL, Sys.LOG_DAEMON, Sys.LOG_SYSLOG, Sys.LOG_LPR, Sys.LOG_NEWS, Sys.LOG_UUCP, Sys.LOG_CRON, Sys.LOG_AUTHPRIV, Sys.LOG_FTP, or Sys.LOG_LOCAL0 to Sys.LOG_LOCAL7.

function gc Click to go up to the list
Force the garbage collector to be invoked
Declaration:
    native function gc( )

function warning Click to go up to the list
Cause ferite to issue an non-fatal warning
Declaration:
    native function warning( string message )
Parameters:
    Parameter #1: string message - The warning to give

function error Click to go up to the list
Cause ferite to throw an exception
Declaration:
    native function error( string message, number value )
Parameters:
    Parameter #1: string message - The error message
    Parameter #2: number value - The error number

function strerror Click to go up to the list
Convert an error return into a string
Declaration:
    native function strerror( number what )
Parameters:
    Parameter #1: number what - The error number to convert
Returns:
    String containing the error

function exit Click to go up to the list
Cause the script to cease executing and set the return value
Declaration:
    native function exit( number retval )
Parameters:
    Parameter #1: number retval - The value to return

function scriptName Click to go up to the list
Get the name of the executing script
Declaration:
    native function scriptName( )
Returns:
    The name of the script

function getVersion Click to go up to the list
Get the version of the engine
Declaration:
    native function getVersion( )
Returns:
    The version of the engine

function system Click to go up to the list
Execute a command and wait for it to return
Declaration:
    native function system( string cms )
Parameters:
    Parameter #1: string cms - The command to run
Returns:
    The return value from the program, -1 on error

function sleep Click to go up to the list
Suspend execution for the specified number of seconds
Declaration:
    native function sleep(number secs)
Description:
This function suspends execution for the specified number of seconds or until a signal interrupts it. If it was interrupted, the number of seconds remaining in the requested interval is returned.
Parameters:
    Parameter #1: number secs - The number of seconds to sleep for

function usleep Click to go up to the list
Suspend execution for microsecond intervals
Declaration:
    native function usleep( number usecs )
Parameters:
    Parameter #1: number usecs - number of microseconds to sleep

function timestamp Click to go up to the list
Generate a double representing a timestamp including microseconds
Declaration:
    native function timestamp()
Returns:
    The timestamp

function stdin Click to go up to the list
Get the stdin system stream for reading
Declaration:
    native function stdin( )
Returns:
    A Sys.StdioStream

function stdout Click to go up to the list
Get the stdout system stream for writing
Declaration:
    native function stdout( )
Returns:
    A Sys.StdioStream

function stderr Click to go up to the list
Get the stderr system stream for writing errors out to
Declaration:
    native function stderr( )
Returns:
    A Sys.StdioStream

Variables

number O_RDONLY Click to go up to the list
Flag to set the file as read only upon open

number O_WRONLY Click to go up to the list
Flag to set the file as write only upon open

number O_RDWR Click to go up to the list
Flag to set the file as read and write upon open

number O_CREAT Click to go up to the list
Flag to create the file upon opening if it does not exist
Description:
The owner (user ID) of the file is set to the effective user ID of the process. The group ownership (group ID) is set either to the effective group ID of the process or to the group ID of the parent directory (depending on filesystem type and mount options, and the mode of the parent directory).

number O_EXCL Click to go up to the list
Make sure that the file is exclusive
Description:
Use this bit anded '&' with O_CREAT to make sure the the file, when created does not already exists.

number O_TRUNC Click to go up to the list
Open the file and trucate it to 0 length
Description:
The open flags must contain the ability to write to the file and it must be a regular disk file [not a device].

number O_APPEND Click to go up to the list
Cause writes to be append to the end of the file
Description:
Using this flag means that before each write occurs the file pointer is set to the end of the file as if an explicit seek had been done.

number LOG_PID Click to go up to the list
Include process ID with log messages
Description:
Using this flag with openlog() causes the log messages it generates to include the process ID number.

number LOG_CONS Click to go up to the list
Log to the system console if unable to write to syslog
Description:
Using this flag with openlog() causes log messages to be written to the system console if it is unable to write them to the system logger.

number LOG_NDELAY Click to go up to the list
Open the syslog connection immediately
Description:
Using this flag with openlog() causes it to open the connection to the system logger instead of waiting until the first message is written to the log.

number LOG_PERROR Click to go up to the list
Log to stderr as well as to the system log
Description:
Using this flag with openlog() causes it to send log messages to stderr as well as to the system log.

number LOG_KERN Click to go up to the list
Kernel log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they come from the system kernel. Not recommended unless you are reimplementing klogd in Ferite.

number LOG_USER Click to go up to the list
User level log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they come from an ordinary user level program (not a daemon- use LOG_DAEMON for that).

number LOG_MAIL Click to go up to the list
Mail system log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they come from the email subsystem.

number LOG_DAEMON Click to go up to the list
Daemon log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they come from any daemon which doesn't have a more specific facility number that it can use.

number LOG_SYSLOG Click to go up to the list
Internal Syslog log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are internal messages from the Syslog system itself. Not recommended unless you are reimplementing the syslog daemon in Ferite.

number LOG_LPR Click to go up to the list
Line printer subsystem log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the line printer subsystem.

number LOG_NEWS Click to go up to the list
News server log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the news server.

number LOG_UUCP Click to go up to the list
UUCP subsystem log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the UUCP subsystem.

number LOG_CRON Click to go up to the list
Cron daemon log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the Cron daemon. Not recommended unless you are reimplementing the cron daemon in Ferite.

number LOG_AUTHPRIV Click to go up to the list
Authorisation/security log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are concerning authorisation of users or general security issues.

number LOG_FTP Click to go up to the list
FTP server log facility
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the FTP server.

number LOG_LOCAL0 Click to go up to the list
Local log facility 0
Description:
Specifying this value as the facility in an openlog() call will cause messages to be logged with a facility value indicating that they are from the locally chosen facility value number 0. There are seven other locally chosen values available (LOG_LOCAL1 to LOG_LOCAL7).

number SIGHUP Click to go up to the list
Hang Up signal

number SIGINT Click to go up to the list
Interrupt signal

number SIGQUIT Click to go up to the list
Quit signal

number SIGILL Click to go up to the list
Illegal Instruction signal

number SIGTRAP Click to go up to the list
Trap signal (used for breakpoints)

number SIGABRT Click to go up to the list
Abort signal

number SIGBUS Click to go up to the list
Bus error signal

number SIGFPE Click to go up to the list
Floating Point Exception signal

number SIGKILL Click to go up to the list
Kill signal

number SIGUSR1 Click to go up to the list
User defined signal 1

number SIGSEGV Click to go up to the list
Segmentation Fault signal

number SIGUSR2 Click to go up to the list
User defined signal 2

number SIGPIPE Click to go up to the list
Broken Pipe signal

number SIGALRM Click to go up to the list
Alarm signal

number SIGTERM Click to go up to the list
Terminate signal

number SIGSTKFLT Click to go up to the list
Stack fault signal

number SIGCHLD Click to go up to the list
Child terminated signal

number SIGCONT Click to go up to the list
Continue signal

number SIGSTOP Click to go up to the list
Stop signal

number SIGTSTP Click to go up to the list
Terminal stop signal

number SIGTTIN Click to go up to the list
Terminal input without a controlling terminal signal

number SIGTTOU Click to go up to the list
Terminal output without a controlling terminal signal

number SIGURG Click to go up to the list
Urgent data on a socket signal

number SIGXCPU Click to go up to the list
CPU time limit exceeded signal

number SIGXFSZ Click to go up to the list
File size limit exceeded signal

number SIGVTALRM Click to go up to the list
Virtual alarm clock signal

number SIGPROF Click to go up to the list
Profiling timer signal

number SIGWINCH Click to go up to the list
Window size change signal

number SIGIO Click to go up to the list
I/O now possible signal

number PRIO_PROCESS Click to go up to the list
Get/set the priority of a process

number PRIO_PGRP Click to go up to the list
Get/set the priority of a process group

number PRIO_USER Click to go up to the list
Get/set the priority of a user

number RLIMIT_CPU Click to go up to the list
Resource limit on CPU time in seconds

number RLIMIT_DATA Click to go up to the list
Resource limit on size of data segment

number RLIMIT_FSIZE Click to go up to the list
Resource limit on file size

number RLIMIT_LOCKS Click to go up to the list
Resource limit on number of file locks

number RLIMIT_MEMLOCK Click to go up to the list
Resource limit on number of bytes of memory to lock into RAM

number RLIMIT_NOFILE Click to go up to the list
Resource limit on number of open files

number RLIMIT_NPROC Click to go up to the list
Resource limit on number of processes current UID can have

number RLIMIT_RSS Click to go up to the list
Resource limit on maximum RSS size in pages

number RLIMIT_STACK Click to go up to the list
Resource limit on maximum stack size in bytes

number RLIM_INFINITY Click to go up to the list
Special resource limit value which means "no limit"

number SEEK_SET Click to go up to the list
The offset is set to offset bytes from the begining of the stream

number SEEK_CUR Click to go up to the list
The offset is set to current location plus offset bytes

number SEEK_END Click to go up to the list
The offset is set to the size of the file plus offset bytes

string Endofline Click to go up to the list
The end of line delimeter

Automatically generated at 8:45pm, Wednesday 08 January 2003 by feritedoc.