Qore Programming Language Reference Manual 1.14.2
|
Functions | |
nothing | Qore::abort () |
Aborts the current program (this function does not return) More... | |
string | Qore::basename (string path) |
Returns a string giving the last element of a file path (meant to be the filename) More... | |
nothing | Qore::basename () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
nothing | Qore::close_all_fd (*softbool strd) |
closes all possible file descriptors; useful in "daemon" processes that may have inherited open file descriptors More... | |
string | Qore::dirname (string path) |
Returns a string giving the path up to a file but not the filename itself. More... | |
nothing | Qore::dirname () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::errno () |
Returns the error code of the last error that occurred in the current thread. More... | |
nothing | Qore::exec (string command) |
Replaces the current process image with another; this function does not return. More... | |
nothing | Qore::exit (softint rc=0) |
Exits the program with the return code passed (this function does not return) More... | |
int | Qore::fork () |
Creates a copy of the current process with a new PID; returns 0 in the child process; returns the child's PID in the parent process. More... | |
list< hash< NetIfInfo > > | Qore::get_netif_list () |
returns a list of network interfaces More... | |
list< hash< auto > > | Qore::getaddrinfo (*string node, *softstring service, softint family=AF_UNSPEC, softint flags=0) |
Returns a list of Address Information Hash for the given node name or string address; if no lookup can be performed then an exception is thrown. More... | |
int | Qore::getegid () |
Returns the effective group ID of the current process. More... | |
int | Qore::geteuid () |
Returns the effective user ID of the current process. More... | |
int | Qore::getgid () |
Returns the real group ID of the current process. More... | |
list< int > | Qore::getgroups () |
returns a list of group IDs that the user is a member of More... | |
*string | Qore::gethostbyaddr (string addr, softint type=AF_INET) |
Returns the official hostname corresponding to the network address passed as an argument. More... | |
nothing | Qore::gethostbyaddr () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash< auto > | Qore::gethostbyaddr_long (string addr, softint type=AF_INET) |
Returns a hash representing all host and address information corresponding to the address and address type passed as arguments. More... | |
nothing | Qore::gethostbyaddr_long () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*string | Qore::gethostbyname (string name) |
Returns the first address corresponding to the hostname passed as an argument or NOTHING if the lookup fails. More... | |
nothing | Qore::gethostbyname () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash< auto > | Qore::gethostbyname_long (string name) |
Returns a hash representing all host and address information corresponding to the hostname passed as an argument. More... | |
nothing | Qore::gethostbyname_long () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::gethostname () |
Returns the hostname of the system. More... | |
int | Qore::getpid () |
Returns the PID (process ID) of the current process. More... | |
int | Qore::getppid () |
Returns the PID (process ID) of the parent process of the current process. More... | |
int | Qore::getuid () |
Returns the real user ID of the current process. More... | |
int | Qore::kill (softint pid, softint sig=SIGHUP) |
Sends a signal to a process, if no signal number is given, then Qore::SIGHUP is sent by default. More... | |
nothing | Qore::kill () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::qore_get_library_options () |
returns all Qore library options More... | |
int | Qore::qore_set_library_options (int opts) |
sets Qore runtime library options More... | |
int | Qore::rand () |
Returns a random non-negative 64-bit integer number. More... | |
int | Qore::setegid (softint gid) |
Changes the process effective group ID according to the argument passed. More... | |
int | Qore::seteuid (softint uid) |
Changes the effective process user ID according to the argument passed. More... | |
int | Qore::setgid (softint gid) |
Changes the process group ID according to the argument passed. More... | |
nothing | Qore::setgroups (softlist< softint > gids) |
sets the list of supplementary group IDs for the current process More... | |
int | Qore::setsid () |
Creates a new session lead by the calling process. More... | |
int | Qore::setuid (softint uid) |
Changes the process user ID according to the argument passed. More... | |
int | Qore::sleep (softint seconds) |
Causes the current thread to sleep for a certain number of seconds. More... | |
nothing | Qore::sleep () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
nothing | Qore::srand (softint seed) |
Seeds the random number generator with the integer passed. More... | |
nothing | Qore::srand () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::strerror (softint err) |
Returns the string corresponding to the error code passed (generally retrieved with errno()) More... | |
string | Qore::strerror () |
Returns the string corresponding to the last error that occurred in the current thread. More... | |
int | Qore::system (string command) |
executes a command and returns the exit code of the process More... | |
nothing | Qore::system () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::usleep (softint usecs) |
Causes the current thread to sleep for a certain number of microseconds. More... | |
int | Qore::usleep (date d) |
Causes the current thread to sleep for a certain number of microseconds. More... | |
nothing | Qore::usleep () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
Library functions
Key | Type | Description |
name | string | The official fully-qualified name of the host |
aliases | list of string | Any hostname aliases for the host |
typename | string | The type of network address (either "ipv4" or "ipv6" ) |
type | int | One of the Network Address Family Constants (either Qore::AF_INET or Qore::AF_INET6) corresponding to the type of network addresses given |
len | int | The length of the addresses in bytes when represented in binary form |
addresses | list of string | All addresses corresponding to the host; the list should have at least 1 element |
Key | Type | Description |
address | string | A valid address of the host, for example: "::1" . |
address_desc | string | A descriptive string of the address containing the address family, for example: "ipv6[::1]" |
family | int | The network address family; see Network Address Family Constants. |
familystr | string | A descriptive string for the network address family, for example: "ipv6" . |
addrlen | int | The length of the internal network address data structure (not normally needed in Qore but provided anyway) |
[port ] | int | The port number corresponding to the service (if applicable) |
nothing Qore::abort | ( | ) |
Aborts the current program (this function does not return)
This function causes the current process to terminate abnormally; a core dump or crash report may be generated if enabled
nothing Qore::basename | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a string giving the last element of a file path (meant to be the filename)
path | the path to process |
nothing Qore::close_all_fd | ( | *softbool | strd | ) |
closes all possible file descriptors; useful in "daemon" processes that may have inherited open file descriptors
strd | if True then also stdin, stdout, and stderr are closed, otherwise fds > 2 are closed |
nothing Qore::dirname | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a string giving the path up to a file but not the filename itself.
path | the path to process |
"."
is returned (meaning the current directory)int Qore::errno | ( | ) |
Returns the error code of the last error that occurred in the current thread.
nothing Qore::exec | ( | string | command | ) |
Replaces the current process image with another; this function does not return.
command | the executable to execute and any command-line arguments; the command is executed internally by a call to execvp() (3) |
nothing Qore::exit | ( | softint | rc = 0 | ) |
Exits the program with the return code passed (this function does not return)
rc | the return code for the process (0 = no error; success) |
int Qore::fork | ( | ) |
Creates a copy of the current process with a new PID; returns 0 in the child process; returns the child's PID in the parent process.
This function will throw an ILLEGAL-FORK
exception if more than one thread is running
ILLEGAL-FORK | Cannot fork if more than one thread is running |
returns a list of network interfaces
list< hash< auto > > Qore::getaddrinfo | ( | *string | node, |
*softstring | service, | ||
softint | family = AF_UNSPEC , |
||
softint | flags = 0 |
||
) |
Returns a list of Address Information Hash for the given node name or string address; if no lookup can be performed then an exception is thrown.
Either node or service may be NOTHING but not both or a QOREADDRINFO-GETINFO-ERROR
exception will be thrown
node | The host name or node name to look up |
service | The service name to look up to a port number |
family | The address family for the lookup, must be one of Qore::AF_INET, Qore::AF_INET6, or Qore::AF_UNSPEC, meaning to return all possible addresses |
flags | see Network Address Information Constants for possible values to be combined with binary or |
QOREADDRINFO-GETINFO-ERROR | nodename nor servname provided, or not known |
int Qore::getegid | ( | ) |
Returns the effective group ID of the current process.
int Qore::geteuid | ( | ) |
Returns the effective user ID of the current process.
int Qore::getgid | ( | ) |
Returns the real group ID of the current process.
returns a list of group IDs that the user is a member of
nothing Qore::gethostbyaddr | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns the official hostname corresponding to the network address passed as an argument.
If the address family is invalid or the address string is not a valid address for the given family a GETHOSTBYADDR-ERROR
exception will be thrown.
addr | the address to look up |
type | the network address family; see Network Address Family Constants for valid values |
GETHOSTBYADDR-ERROR | invalid address for the given family or invalid address family |
nothing Qore::gethostbyaddr_long | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a hash representing all host and address information corresponding to the address and address type passed as arguments.
If the address family is invalid or the address string is not a valid address for the given family a GETHOSTBYADDR-ERROR
exception will be thrown.
addr | the address to look up |
type | the network address family; see Network Address Family Constants for valid values |
GETHOSTBYADDR-ERROR | invalid address for the given family or invalid address family |
nothing Qore::gethostbyname | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns the first address corresponding to the hostname passed as an argument or NOTHING if the lookup fails.
name | the name to look up |
nothing Qore::gethostbyname_long | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a hash representing all host and address information corresponding to the hostname passed as an argument.
name | the name to look up |
string Qore::gethostname | ( | ) |
Returns the hostname of the system.
int Qore::getpid | ( | ) |
Returns the PID (process ID) of the current process.
int Qore::getppid | ( | ) |
Returns the PID (process ID) of the parent process of the current process.
int Qore::getuid | ( | ) |
Returns the real user ID of the current process.
nothing Qore::kill | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Sends a signal to a process, if no signal number is given, then Qore::SIGHUP is sent by default.
pid | the pid argument can have the following interpretations:
|
sig | the signal number to send to the process or processes |
int Qore::qore_get_library_options | ( | ) |
returns all Qore library options
sets Qore runtime library options
opts | the runtime options to set, binary-anded with Qore::QLO_RUNTIME_OPTS; see Qore Library Option Constants and QLO_RUNTIME_OPTS for more information |
int Qore::rand | ( | ) |
Returns a random non-negative 64-bit integer number.
This function uses the C library function random()
to generate the number if available on the current platform, otherwise uses rand
().
int Qore::setegid | ( | softint | gid | ) |
Changes the process effective group ID according to the argument passed.
gid | the group ID to set |
int Qore::seteuid | ( | softint | uid | ) |
Changes the effective process user ID according to the argument passed.
uid | the user ID to set |
int Qore::setgid | ( | softint | gid | ) |
Changes the process group ID according to the argument passed.
gid | the group ID to set |
nothing Qore::setgroups | ( | softlist< softint > | gids | ) |
sets the list of supplementary group IDs for the current process
gids | a list of supplementary group IDs for the current process |
int Qore::setsid | ( | ) |
Creates a new session lead by the calling process.
The calling process is the session leader of the new session, is the process group leader of a new process group and has no controlling terminal. The calling process is the only process in either the session or the process group.
int Qore::setuid | ( | softint | uid | ) |
Changes the process user ID according to the argument passed.
uid | the user ID to set |
nothing Qore::sleep | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
int Qore::sleep | ( | softint | seconds | ) |
Causes the current thread to sleep for a certain number of seconds.
seconds | The amount of time in seconds to sleep; integer arguments are interpreted literally as a number of seconds to sleep, however a relative date/time value can be given instead of an integer to make the source more readable (ex: 5s ), however as this function only supports a resolution of 1 second, milliseconds and microseconds are ignored if passed in a relative date/time value |
nothing Qore::srand | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
nothing Qore::srand | ( | softint | seed | ) |
Seeds the random number generator with the integer passed.
This function uses the C library function srandom() if available on the current platform, otherwise uses srand()
seed | the seed for the random number generator (only the least-significant 32-bits are used) |
string Qore::strerror | ( | ) |
Returns the string corresponding to the last error that occurred in the current thread.
string Qore::strerror | ( | softint | err | ) |
Returns the string corresponding to the error code passed (generally retrieved with errno())
err | the error code to retrieve the description for (generally provided by errno()) |
"Unknown error: -1"
is returnednothing Qore::system | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
executes a command and returns the exit code of the process
command | the command to execute with system() (3) |
nothing Qore::usleep | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Causes the current thread to sleep for a certain number of microseconds.
d | A time value giving the amount of time in microseconds to sleep; this should be a relative date/time value to make the source more readable (ex: 250ms ) |
int Qore::usleep | ( | softint | usecs | ) |
Causes the current thread to sleep for a certain number of microseconds.
usecs | The amount of time in microseconds to sleep; integer arguments are interpreted literally as a number of microseconds to sleep |