[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] file_slurp - read/write entire files from/to a string (module design discussion)
- From: David Manura <dm.lua@...>
- Date: Sat, 5 Nov 2011 22:46:55 -0400
On Thu, Nov 3, 2011 at 10:29 PM, David Manura <dm.lua@math2.org> wrote:
> file_slurp [1] provides simple functions to read/write entire files from/to a string.
Here's two more Perl-inspired modules written in the same style to
solve another common problem.
SYNOPSIS
-- /qux/bar/baz.lua
print(require 'findbin'.bin) --> prints directory of script (/qux/bar)
require 'lib' (require 'findbin' '/../lib')
-- adds a path relative to the directory of the current script to the
-- package search paths (package.path & package.cpath).
require 'foo' -- loads from new search paths (/qux/lib/foo.lua)
[1] https://gist.github.com/1342365
module 'findbin' - Locate directory of original Lua script
[2] https://gist.github.com/1342319
module 'lib' - Simple insertion of directories in package search paths.
[3] https://gist.github.com/1325400
module 'file_slurp' - Easily read/write entire files from/to a string.