Lfs

From GiderosMobile
Revision as of 23:21, 9 March 2020 by MoKaLux (talk | contribs) (added example)


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2012.8

Description

LFS or LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.

LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.

For more information and detailed documentation, please visit http://keplerproject.github.io/luafilesystem/manual.html#reference.

Example

local mypixel = Pixel.new(0xff0000, 1, 64, 64)
local myrt = RenderTarget.new(mypixel:getWidth(), mypixel:getHeight())
myrt:draw(mypixel)

local lfs = require "lfs"
lfs.chdir("c:/temp") -- on windows ("c:\\temp") also works
local dir = lfs.currentdir().."\\" -- append \
myrt:save(dir.."myfile.png") -- saved to "C:\temp\myfile.png"

Methods

Events

Constants