This module allows you to manipulate strings in memory as if they were files. It can be used to create strings from many parts (like a stringbuffer), or to read strings a line at a time, or to simulate real files.
Source code available on Gitorious.
Released 13 July 2012. Download lua-memoryfile-1.2.tar.gz.
- Fix build problem with libtool (requires compiler to be called ‘gcc’, not ‘cc’).
- Remove support for building Windows DLL.
- Upgrade included version of Lunit test system to version 0.5.
Released 19 April 2008. Download lua-memoryfile-1.1.tar.gz.
- Warning: this release changes the behaviour of the ‘close’ and ‘size’ methods in a way which is not backwards compatible with version 1.0, although these small changes are unlikely to affect real code.
- The ‘close’ method now does the same as ‘size(0)’, so it can be used to free the buffer associated with a memoryfile object. This is so that code which relies on ‘close’ freeing up resources can be used with memoryfile objects as well as real file handles.
- The ‘size’ method now returns the old size, before the method began, rather than the new size after it has been changed. This will only affect code which uses a single call to ‘size’ to both get and set the size. The change is to bring this method into line with accessors in my other libraries.
- Impose minimum size on buffer to avoid excessive reallocation.
- The version number is no longer included in the userdata metatable name in the Lua registry, so for all future versions the file handles will have the same metatable name. This makes it possible, although not necessarily recommended, for C code to directly manipulate these objects.
- Switch test suite from Lunit 0.3 to Lunit 0.4alpha.
Released 21 September 2007. Download lua-memoryfile-1.0.tar.gz.
- Initial release.