Please try the demo. It's working on Linux and Windows 7. I don't have a Mac (don't even know how is love._os for Mac), but since it's soooo BSD I'm trying the Linux code. Hope it works.
Generally, I'm using terminal commands to do everything.
Updated 2016/11/07
Compatibility with Love 0.10.2
Changes:
ffi calls
Gspot GUI Demo
Source:https://github.com/linux-man/lovefs
Updated 2014/11/05
Compatibility with Love 0.9.1
Changes:
LoveFrames-0.9.8.1 (modified) Updated 2014/01/17
New version for Love 0.9
Changes:
LoveFrames-0.9.7-1 (modified)
If on Windows drives can't be obtained, a default list of drive letters is returned (from A: to J:) Windows users will have to see a lot of terminals flashing (there's no other way, at least until Love is builded with LuaFileSystem).
For those interested:
To start, (look at the demo code)
fs = lovefs(dir[string]) -- if no dir is given, start on UserDirectory
---------------------------------------- lovefs.lua -------------------------------------------------
fs.current -- Current Directory [string] (don't change it, use fs:cd(dir))
fs.drives, fs.dirs, fs.files, fs.all -- drives (detected at start), directories and files in current dir [tables].
(internal) function fs:loadCp(codepage[string]) -- Load terminal codepage. Use only for testing. Return FALSE if codepage is not supported.
Supported codepages: '737', '775', '850', '852', '855', '866', '8859-1', '8859-2', '8859-4', '8859-5', '8859-7', '8859-15', '8859-16', 'KOI8-R', 'KOI8-U'
Note: Windows 473 and Linux UTF-8 don't need translation. If Windows codepage is not supported, non-ascii chars are changed to '?'. It should work because files are opened using 8.3 names.
(internal) function fs:toUtf8(str[string]) -- return string translated to utf-8
(internal) function fs:toCp(str[string]) -- return string translated to current codepage
(internal) function fs:path8p3(dir[string], all[boolean]) -- return Windows path in 8.3 format
(internal) function fs:run(command[string]) -- Execute command on console
function fs:setParam(param[string]) -- Used by :cd() to populate fs.dirs and fs.files. Useful to apply filters like '*.jpg'
function fs:ls(param[string], dir[string]) -- return file list (table and string). Alias: fs:dir(param, dir). if dir is NIL, uses fs.current.
function fs:lsDrives() -- return drives (table)
function fs:lsDirs(param[string], dir[string]) -- return directories (table and string) Ex: tb_dirs, str_dirs = fs:lsDirs()
function fs:lsFiles(param[string], dir[string]) -- return files (table and string)
function fs:exists(name[string], dir[string]) -- return TRUE if exists.
function fs:isDirectory(name[string], dir[string]) -- return TRUE if directory.
function fs:isFile(name[string], dir[string]) return TRUE if is file.
function fs:cd(dir[string]) -- Change directory. Populate fs.dirs, fs.files and fs.all with the new directory contents. Files list use filter defined in fs:setParam.
Note: if dir is NIL current directory is used
function fs:up() -- same as fs
(internal) function fs:copy(source[string], dest[string]) -- copy file
function fs:loadImage(source[string]) -- return image. If no source, uses fs.SelectedFile. Attention: This function NILs fs.selectedFile.
function fs:loadSource(source[string]) --return sound. If no source, uses fs.SelectedFile. Attention: This function NILs fs.selectedFile.
function fs:loadFont(size[int], source[string]) --return font. If no source, uses fs.SelectedFile. Attention: This function NILs fs.selectedFile.
function fs:saveImage(img, dest[string]) -- Need Canvas support. Return FALSE on failure. . If no source, uses fs.SelectedFile. Attention: This function NILs fs.selectedFile.
---------------------------------------- dialogs.lua ------------------------------------------------
Load and Save Dialogs using LoveFrames (modified)
dialog = loadDialog(lovefs, filters[table])
dialog = saveDialog(lovefs, filters[table])
Example:
fs = lovefs()
dialog = loadDialog(fs, {'All | *.*', 'Images | *.jpg *.bmp *.png'})
On close with OK, the path of the chosen file is stored at fs.selectedFile.
'|' is optional. You can write only the masks.