5. The System library
The system library exposes operating system facilities like environment variables, process execution and file operations
5.1. Squirrel API
5.1.1. Global Symbols
- getenv(varaname)
Returns a string containing the value of the environment variable varname
- remove(path)
deletes the file specified by path
- rename(oldname, newname)
renames the file or directory specified by oldname to the name given by newname
- system(cmd)
executes the string cmd through the os command interpreter.
5.2. C API
-
SQRESULT sqstd_register_systemlib(HSQUIRRELVM v)
- Parameters
v (HSQUIRRELVM) – the target VM
- Returns
an SQRESULT
- Remarks
The function aspects a table on top of the stack where to register the global library functions.
initialize and register the system library in the given VM.