Saving a File that you package with your app.
Posted: Thu Sep 08, 2011 7:22 pm
Hello,
I am trying to copy a SQlite file from my prepackaged app to the docs folder on my iPhone. I have had no success following another example I found on the forums that was similar. This is the code that I have modified. Any ideas? The file does exist in the docs folder it just seems to be corrupt as it contains no data and is 0kb in size after being copied. Originally the file is 3kb and had some tables in it.
I am trying to copy a SQlite file from my prepackaged app to the docs folder on my iPhone. I have had no success following another example I found on the forums that was similar. This is the code that I have modified. Any ideas? The file does exist in the docs folder it just seems to be corrupt as it contains no data and is 0kb in size after being copied. Originally the file is 3kb and had some tables in it.
Code: Select all
if the environment is "mobile" then
put (specialFolderPath("Documents") & "/System.sqlite") into tPathToDatabase
put (specialFolderPath("engine") & "System.sqlite") into tPathToStartLoc
try
if not (there is a file tPathToDatabase) then
put url ("binfile:" & tPathToStartLoc) into temp
put temp into url ("binfile:" & specialfolderpath("Documents") & "/System.sqlite")
wait 5 milliseconds with messages
end if
catch pErr
put pErr into field 1
end try
try
go stack tPathToDatabase
catch pErr
put pErr into field 1
end try
end if