I am successfully using the camera example in one of my scenes and I don’t want to leave photos stored in any directory of any device.
I am using this from the os.remove example
--forward declaration local destDir = system.DocumentsDirectory -- Location where the file is stored local result, reason = os.remove( system.pathForFile( "Picture1.jpg", destDir ) ) -- Scene event functions local function backButtonTouch( event ) if ( event.phase == "began" ) then audio.play( flick ) if result then print( "Picture1 removed" ) else print( "Picture1 does not exist", reason ) end elseif ( event.phase == "ended" ) then composer.gotoScene( "menu" ) end return true end
The simulator does not give me any error. My test device either. The picture is saved as Picture1 in the Pictures directory of my device. If I take another picture it will be saved as Picture2 … Picture3 … etc.
Could someone help me understand this?