--- Miscellaneous utility functions

module "pepper.utils"


--- Opens a unique temporary file.
-- @param template An optional filename template
-- @return A pair containing the file handle and the file name
function mkstemp(template)

--- Removes a file or directory.
-- @param path The path to the file
-- @param recurse Recurse into subdirectories (default is false)
function unlink(path, recurse)

--- Splits the given string.
-- @param string The string
-- @param pattern A pattern specifying the split points (not a regular expression)
function split(string, pattern)

--- Wrapper for strptime(3).
--  The C function strprime(3) can parse string representations of time. The
--  time format will be passed directly to strptime(3), so you can check the
--  <a href="http://www.kernel.org/doc/man-pages/online/pages/man3/strptime.3.html">corresponding man page</a>
--  for a possible field specifiers.
--  @param s String describing a time
--  @param format Time format
--  @return A UNIX timestamp
function strptime(s, format)

--- Returns the directory portion of a pathname.
--  This function acts like <a href="http://en.wikipedia.org/wiki/Dirname">dirname(1)</a>,
--  i.e. it also returns a dot if the given path contains no slash.
function dirname(path)

--- Returns the  non-directory portion of a pathname.
--  This function acts like <a href="http://en.wikipedia.org/wiki/Basename">basename(1)</a>,
--  but doesn't strip suffixes.
function basename(path)
