Cool! Something like this?
–[lua]local pathRead = system.pathForFile( “screenShot1.jpg”,system.ResourceDirectory )
local file = io.open( pathRead, “r” )
local imageData = file:read( “*a” )
io.close( file )
local myImage
local pathWrite = system.pathForFile( “image.jpg”, system.DocumentsDirectory )
local file = io.open( pathWrite, “w” )
file:write( myImage )
io.close( file )
file = nil[/lua]
My guess this will open the screenShot image in the directory where main.lua reside (and the screenshot…not really a screenshot but any image put in there…marketing…) and transfer it into the system.DocumentsDirectory as myImage
Would this make sense to you? I have to admit I did not work with file I/O so it is all very confusing still. I found this great info here:
http://www.coronalabs.com/blog/2012/02/14/reading-and-writing-files-in-corona/
Thanks again.
Mo
EDIT: I found exactly what I was looking for here BUT I am not sure if the “bug” people were talking about in that page is still there. I will investigate but the function looks very good and simple enough!
copyFile( “Icon.png”, system.ResourceDirectory, “NewIcon.png”, system.DocumentsDirectory )
[import]uid: 100814 topic_id: 33545 reply_id: 133321[/import]