You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mark 5d1c269b6d broken getenv
avoid initializer warnings in GCC in file_lock
19 years ago
posix reformatted -- use spaces instead of tabs. 19 years ago
tests A few changes. 20 years ago
w32api broken getenv 19 years ago
.cvsignore *** empty log message *** 20 years ago
COPYRIGHT *** empty log message *** 20 years ago
Changelog 20070110T1431-0700 20 years ago
INSTALL 20070110T1431-0700 20 years ago
Makefile 20070110T1431-0700 20 years ago
README 20070110T1431-0700 20 years ago
conf.in 20070110T1431-0700 20 years ago

README

"ex" API implementation
http://lua-users.org/wiki/ExtensionProposal
Copyright 2007 Mark Edgar < medgar at student gc maricopa edu >

-- Environment
os.getenv(name) -- get environment variable
os.setenv(name, value) -- set/unset environment variable
os.environ() -- returns a copy of the environment

-- File system
cwd = os.currentdir()
os.chdir(pathname)
os.mkdir(pathname)
os.remove(pathname)

for entry in os.dir(pathname) do ; end
entry = os.dirent(pathname)
--[[
  entry is a table, containing at least the following keys:
  name: the filename
  type: "file" or "directory" or another implementation-defined string
  size: the file size in bytes
--]]

-- Locking and pipes
file = io.open("filename", "w")
file:lock(mode, start, length) -- mode is "r" or "w", start and length are optional
file:unlock(start, length) -- start and length are optional
in, out = io.pipe()

-- Process control
os.sleep(seconds) -- sleep for (floating-point) seconds
os.sleep(interval, unit) -- sleep for interval/unit seconds
pid = os.spawn(filename, {args={}, env={}, stdin=file, stdout=file, stderr=file})
exitcode = pid:wait(pid)