Basically just want to pull a list of files in a code subdirectory (i.e.: projectname/languages). Is there any way to actually do this with LFS? (I just get a message that there’s no file or directory).
[lua]local lfs = require(“lfs”)
lfs.chdir( system.pathForFile("", system.ResourceDirectory) )
local path = lfs.currentdir()…"/languages"
– Load in each file found
for file in lfs.dir(path) do
– stuff
end[/lua]
(Note: I’ve found you have to set lfs.chdir at first; if you try just going with lfs.currentdir() stuff like Corona SDK’s boot up or some document utils (GGData) will change currentdir() to DocumentsDirectory and bust your entire code setup…)
cannot open /Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/CoronaResources.bundle/Contents/Resources/languages/: No such file or directory
(if main.lua is in Resources, /languages/ does exist, and so do lua files within /languages)