hslua-module-system-1.1.1: Lua module wrapper around Haskell's System module.
Copyright© 2019-2024 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@hslua.org>
Stabilityalpha
PortabilityRequires GHC 8 or later.
Safe HaskellSafe-Inferred
LanguageHaskell2010

HsLua.Module.System

Description

Provide a Lua module containing a selection of System functions.

Synopsis

Module

documentedModule :: LuaError e => Module e Source #

The "system" module.

Fields

arch :: Field e Source #

Module field containing the machine architecture on which the program is running. Wraps arch

compiler_name :: Field e Source #

Module field containing the Haskell implementation with which the host program was compiled. Wraps compilerName.

compiler_version :: LuaError e => Field e Source #

Module field containing the version of compiler_name with which the host program was compiled.

os :: Field e Source #

Field containing the operating system on which the program is running.

Functions

cputime :: LuaError e => DocumentedFunction e Source #

Access the CPU time, e.g. for benchmarking.

env :: LuaError e => DocumentedFunction e Source #

Retrieve the entire environment

getenv :: LuaError e => DocumentedFunction e Source #

Returns the value of an environment variable

getwd :: LuaError e => DocumentedFunction e Source #

Return the current working directory as an absolute path.

ls :: LuaError e => DocumentedFunction e Source #

List the contents of a directory.

mkdir :: LuaError e => DocumentedFunction e Source #

Create a new directory which is initially empty, or as near to empty as the operating system allows.

If the optional second parameter is false, then create the new directory only if it doesn't exist yet. If the parameter is true, then parent directories are created as necessary.

rmdir :: LuaError e => DocumentedFunction e Source #

Remove an existing directory.

setenv :: LuaError e => DocumentedFunction e Source #

Set the specified environment variable to a new value.

setwd :: LuaError e => DocumentedFunction e Source #

Change current working directory.

tmpdirname :: LuaError e => DocumentedFunction e Source #

Get the current directory for temporary files.

with_env :: LuaError e => DocumentedFunction e Source #

Run an action, then restore the old environment variable values.

with_wd :: LuaError e => DocumentedFunction e Source #

Run an action in a different directory, then restore the old working directory.