Jason,
It works! I did a quick test and you can see the results here:

What I did is create a small app that saves an image of a display object to the Documents directory on the iPhone (system.DocumentsDirectory). The next time I dod a sync with iTunes, it was available in the file sharing section. The code below is supposed to list the files in the Documents directory. It works on the simulator, but not on the iPhone - but that is for display purposes only. The file sharing part sill works.
Here’s the code:
build.settings
settings = {
orientation =
{
default = "landscapeLeft",
supported = {
"landscapeLeft", "landscapeRight",
},
},
iphone =
{
plist=
{
UIFileSharingEnabled=true
},
},
}
main.lua:
[code]
local testBg = display.newRect(0,20,50,50)
testBg:setFillColor(23, 192, 50, 255)
local myGroup = display.newGroup()
local textObj = {}
display.save( testBg, “test.png”, system.DocumentsDirectory )
– function borrowed from some Lua site on the internet
function scandir(dirname)
dirname = string.gsub(dirname, “(%s)”, “\%1”)
callit = os.tmpname()
os.execute(“ls -a1 “…dirname … " >”…callit)
f = io.open(callit,“r”)
rv = f:read(”*all")
f:close()
os.remove(callit)
tabby = {}
local from = 1
local delim_from, delim_to = string.find( rv, “\n”, from )
while delim_from do
table.insert( tabby, string.sub( rv, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( rv, “\n”, from )
end
– Comment out eliminates blank line on end!
return tabby
end
– function borrowed from some Lua site on the internet
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end
files = system.pathForFile( “*”, system.DocumentsDirectory )
filetab = scandir(files)
– print (“Directory contents”)
textTitle = display.newText(“files in Documents directory:”, 0, 90, “Courier Bold”, 16)
textTitle:setTextColor(255,255,255,255)
textTitle.x = 50 + textTitle.width/2
myGroup:insert(textTitle)
local textY = 100
for n,v in ipairs(filetab) do
– print (n,v)
textY = textY + 10
dirs = string.split(v,"/")
filename = dirs[table.maxn(dirs)]
textObj[n] = display.newText(filename, 0, textY, “Courier”, 14)
textObj[n]:setTextColor(255,255,255,255)
textObj[n].x = 50 + textObj[n].width/2
myGroup:insert(textObj[n])
end
[/code] [import]uid: 8194 topic_id: 1766 reply_id: 5329[/import]