how know if an image exits?

How can I use a IF to check if an image are in my system.DocumentsDirectory? [import]uid: 23063 topic_id: 17063 reply_id: 317063[/import]

Try something like this:

local function doesFileExist(filename)  
 local path = system.pathForFile( filename, system.DocumentsDirectory)  
 local file = io.open( path, "r" )  
 local fileExists = false  
 if file then  
 io.close( file )  
 fileExists = true  
 end  
 return fileExists  
end  

[import]uid: 19626 topic_id: 17063 reply_id: 64113[/import]

thank you !!

dude, you are an genius, serious

thank you so much [import]uid: 23063 topic_id: 17063 reply_id: 64290[/import]

On Android devices, for system.ResourceDirectory, it doesn’t work. What I should do for use it in this situation? [import]uid: 57694 topic_id: 17063 reply_id: 89636[/import]