LuaFileSystem in CoronaSomething that has been consistently requested for a while now was more file-system related control, that is, more than what the current File I/O API allows you to do. Such as, allowing developers to get the listing of files in a specific directory, create folders (in Documents and Temporary directories), remove directories, and even get the attributes of a specific file—all things that have been impossible to do in Corona.

Impossible until now, that is. I’m happy to announce that coming soon to a daily-build-near-you is the highly-requested LuaFileSystem (LFS) library, which will enable all the things mentioned, as well as a little more.

What this also means is that awesome libraries that depend on LuaFileSystem, such as Penlight is now available for use in Corona projects! Please keep in mind, however, that some functionality of 3rd party Lua libraries may not be present depending on other dependencies, or if they try to do things that are not permitted on your target device.

LuaFileSystem will be available starting in the next daily build (we’re working on getting it posted). Once it’s ready, using it is simply a matter of adding:


local lfs = require "lfs"

…In the Lua source file you plan on using it. From there, take a look at the LFS Reference for a listing of all the functions and syntax (a tutorial will be coming soon!).

While you’re waiting for the build to post, subscribe now so you can get it as soon as it’s available. As a reminder, access to daily builds is a benefit extended to Corona subscribers only.

Bug Fixes

Speaking of daily builds, we pushed in a number of bug fixes over the past few weeks. Listed below is just a few of the major ones, but you can see a complete listing here.

  • Fixed “bad builds” issue due to problems with build.settings (you’ll now get an error).
  • Windows: stderr is now logged to the Corona Simulator output console.
  • Several Kindle Fire and Nook-specific bug fixes.
  • Several Storyboard and Widget bug fixes.
  • Added workarounds for OpenAL suspend/resume bugs having to do with multiple OpenAL apps running at once.
  • Fixed crashes that occurred when touching masked objects.
  • Fixed post-collision mis-reporting bugs.
  • Several internal OpenGL-related issues.
  • display.newText() bug fixes.
  • And more!

Once again, the above list is just a short sample—there’s too many to list! To see a complete listing of all the bug fixes, additions, and other changes, see the daily build summary page.

And if you haven’t already, subscribe now to get the latest build today.

  1. so, would this make it easier to read zipped files? I’m thinking of the case of eBooks and reading in a common eBook format (which tends to come in zipped packages).

  2. Jonathan Beebe says:

    @Joakim: Unfortunately LFS does not address the donotbackupflag stuff—that is on our radar though, so stay tuned :-)

  3. Interesting that you mention Penlight. I wasn’t aware of it so I clicked the link read the first line and thought, hmm, this sounds like the kind of thing Python is good at. Sure enough the next line states it was based on Python functionality :)

    Though Lua is fine to use it would have been interesting to be programming Corona in Python ;-)

  4. What about the bug that drops the FPS to 2-3 when using physics on some Android devices ?

    Think that bug was introduced somewhere at 796…

  5. Robert de Boer says:

    display.newText() still has a bug when using multiline text, and CenterReference point, only the first line is centered…

  6. It shouldn’t be too difficult to get a listing of multiple files with the current file api.

    For instance – if your individual files are numbered – you can loop through them with an array. Save the files name as the first line in each file, then read the names. Then when you pick a file name from a list, you just fetch file number x and voila.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>