LuaFileSystem (LFS) Coming Soon

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

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.

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

This entry has 11 replies

  1. Peter says:

    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:

    Unfortunately LFS doesn’t come with zip support — but that’s another thing in the pipeline!

  3. Joakim says:

    Woww, would this solve the issue with donotbackup flag in documents folder?


  4. Jonathan Beebe says:

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

  5. Ken Ibrahim says:

    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 😉

  6. Damir says:

    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…

  7. Marcelo says:

    I don’t see any information about the display.newText() bug fixes in the Daily build summary page?

  8. Robert de Boer says:

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

  9. Nenad Katic says:

    Lua Files System + ZIP support = Falling in love with Corona again! 🙂

  10. Arno says:

    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.

  11. Peter says:

    *cough* bluetooth support *cough* so that I can use the icade