GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing lua-stdlib.github.io — stdlib Reference stdlibContentsCore Libraries
Core FunctionsModule
|
| find (pathstrings, patt[, init=1[, plain=false]]) | Look for a path segment match of patt in pathstrings. |
| insert (pathstrings[, pos=n+1], value) | Insert a new element into a package.path like string of paths. |
| mappath (pathstrings, callback, ...) | Call a function with each element of a path string. |
| normalize (...) | Normalize a path list. |
| remove (pathstrings[, pos=n]) | Remove any element from a package.path like string of paths. |
| package | Make named constants for package.config
(undocumented in 5.1; see luaconf.h for C equivalents). |
| mappathcb (element, ...) | Function signature of a callback for mappath. |
pathsep delimited path elements
element(not byte index!) to start search at.
Negative numbers begin counting backwards from the last element
(default 1)
unless false, treat patt as a plain
string, not a pattern. Note that if *plain* is given, then *init*
must be given as well.
(default false)
the matching element number(not byte index!) and full text
of the matching element, if any; otherwise nil
i, s = find(package.path, '^[^' .. package.dirsep .. '/]')
package.path like string of paths.
package.path like string
element index at which to insert value, where n is
the number of elements prior to insertion
(default n+1)
package.path = insert(package.path, 1, install_dir .. '/?.lua')
package.path like string
mappath(package.path, searcherfn, transformfn)
. and .. directories, and keep only the first
instance of duplicate elements. Each argument can contain any number
of pathsep delimited elements; wherein characters are subject to
/ and ? normalization, converting / to dirsep and ? to
path_mark(unless immediately preceded by a % character).
pathsep delimited paths string
package.path = normalize(user_paths, sys_paths, package.path)
package.path like string of paths.
package.path like string
element index from which to remove an item, where n
is the number of elements prior to removal
(default n)
package.path = remove(package.path)
package.config
(undocumented in 5.1; see luaconf.h for C equivalents).