-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Lua module wrapper around Haskell's System module.
--   
--   Provides access to system information and functionality to Lua scripts
--   via Haskell's <a>System</a> module.
--   
--   Intended usage for this package is to preload it by adding the loader
--   function to `package.preload`. Note that the Lua <a>package</a>
--   library must have already been loaded before the loader can be added.
@package hslua-module-system
@version 0.2.1


-- | Provide a Lua module containing a selection of
--   <tt><tt>System</tt></tt> functions.
module Foreign.Lua.Module.System

-- | Pushes the <tt>system</tt> module to the Lua stack.
pushModule :: Lua NumResults

-- | Add the <tt>system</tt> module under the given name to the table of
--   preloaded packages.
preloadModule :: String -> Lua ()

-- | The machine architecture on which the program is running.
arch :: String

-- | The Haskell implementation with which the host program was compiled.
compiler_name :: String

-- | The version of <a>compiler_name</a> with which the host program was
--   compiled.
compiler_version :: [Int]

-- | The operating system on which the program is running.
os :: String

-- | Retrieve the entire environment
env :: Lua NumResults

-- | Return the current working directory as an absolute path.
getwd :: Lua FilePath

-- | Returns the value of an environment variable
getenv :: String -> Lua (Optional String)

-- | List the contents of a directory.
ls :: Optional FilePath -> Lua [FilePath]

-- | Create a new directory which is initially empty, or as near to empty
--   as the operating system allows.
--   
--   If the optional second parameter is <tt>false</tt>, then create the
--   new directory only if it doesn't exist yet. If the parameter is
--   <tt>true</tt>, then parent directories are created as necessary.
mkdir :: FilePath -> Bool -> Lua ()

-- | Remove an existing directory.
rmdir :: FilePath -> Bool -> Lua ()

-- | Set the specified environment variable to a new value.
setenv :: String -> String -> Lua ()

-- | Change current working directory.
setwd :: FilePath -> Lua ()

-- | Get the current directory for temporary files.
tmpdirname :: Lua FilePath

-- | Run an action, then restore the old environment variable values.
with_env :: Map String String -> Callback -> Lua NumResults
with_tmpdir :: String -> AnyValue -> Optional Callback -> Lua NumResults

-- | Run an action in a different directory, then restore the old working
--   directory.
with_wd :: FilePath -> Callback -> Lua NumResults
