Use LuaFileSystem

Issue #511 wontfix
created an issue

There seems to be a lot of inconsistencies within the love.filesystem. Perhaps we could consider re-writing the love.filesystem to act as a wrapper for LuaFileSystem and Penlight. This way, we know we can be more cross-platform, and offer a way for users to be able to use a universal way to create paths via penlight.

Here is some of the filesystem's functions and what they could use instead;

love.filesystem.enumerate => iter, dir_obj = lfs.dir (path) & pl.dir
love.filesystem.exists => lfs.attributes (filepath [, aname])
love.filesystem.getAppdataDirectory => pl.dir
love.filesystem.getLastModified => lfs.attributes (filepath [, aname])
love.filesystem.getSaveDirectory => pl.dir
love.filesystem.getUserDirectory => pl.dir
love.filesystem.getWorkingDirectory => lfs.currentdir () & pl.dir
love.filesystem.isDirectory => lfs.attributes (filepath [, aname])
love.filesystem.isFile => lfs.attributes (filepath [, aname])
love.filesystem.mkdir => lfs.mkdir (dirname) && pl.dir
love.filesystem.remove => os.remove(path)
love.filesystem.setIdentity => pl.dir
love.filesystem.setSource => pl.dir

I understand there is a lot of discussion about security in love when it comes to the love.filesystem, but I think we ought to consider letting users use pl, lfs to it's full extend. Perhaps offer a build flag to disable non save directory filesystem commands.

Comments (3)

  1. Anders Ruud repo owner

    Surely, it must be easier to fix the inconsistencies. What are they?

    PhysicsFS currently provides nice on-the-fly decompression of .zip files, as you know. LFS does not do that (AFAIK) ... does Penlight?

  2. Log in to comment