| Copyright | © 2019 Albert Krewinkel |
|---|---|
| License | MIT |
| Maintainer | Albert Krewinkel <albert+hslua@zeitkraut.de> |
| Stability | alpha |
| Portability | Requires GHC 8 or later. |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Lua.Module.System
Description
Provide a Lua module containing a selection of functions.System
Synopsis
- pushModule :: Lua NumResults
- preloadModule :: String -> Lua ()
- arch :: String
- compiler_name :: String
- compiler_version :: [Int]
- os :: String
- env :: Lua NumResults
- getwd :: Lua FilePath
- getenv :: String -> Lua (Optional String)
- ls :: Optional FilePath -> Lua [FilePath]
- mkdir :: FilePath -> Bool -> Lua ()
- rmdir :: FilePath -> Bool -> Lua ()
- setenv :: String -> String -> Lua ()
- setwd :: FilePath -> Lua ()
- tmpdirname :: Lua FilePath
- with_env :: Map String String -> Callback -> Lua NumResults
- with_tmpdir :: String -> AnyValue -> Optional Callback -> Lua NumResults
- with_wd :: FilePath -> Callback -> Lua NumResults
Module
pushModule :: Lua NumResults Source #
Pushes the system module to the Lua stack.
preloadModule :: String -> Lua () Source #
Add the system module under the given name to the table of
preloaded packages.
Fields
compiler_name :: String Source #
The Haskell implementation with which the host program was compiled.
compiler_version :: [Int] Source #
The version of compiler_name with which the host program was
compiled.
Functions
env :: Lua NumResults Source #
Retrieve the entire environment
mkdir :: FilePath -> Bool -> Lua () 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.
tmpdirname :: Lua FilePath Source #
Get the current directory for temporary files.
with_env :: Map String String -> Callback -> Lua NumResults Source #
Run an action, then restore the old environment variable values.
Arguments
| :: String | parent dir or template |
| -> AnyValue | template or callback |
| -> Optional Callback | callback or nil |
| -> Lua NumResults |