File.Copy & java.io.IOException

johnthomcode

Member
Licensed User
Longtime User
In the IDE, I went to 'Files' and added 'mydatabase.dat' as a file. In Activity_Create, I added (among other code):

File.Copy ( File.DirAssets, "mydatabase.dat", File.DirInternal, "mydatabase.dat" )

I did this so that I could load this file as a SQLite database. I only need to read from it, but understand it needs to be in a writable location (I think I'm right).

The line of code listed above causes an error every time. I have another, almost identical program (only the data and names are different)... It works without issue every time. I just tried again to confirm again.

I am using v1.48.

The only real difference is that the failing File.Copy line has to do with a 1.05 MB database and the working one is a .2 MB database? (Although I have 17MB free...)

I also noticed that the working version also has a "main.bal" in the "Files" section and the other one doesn't (but I don't believe I added this)?

Can anyone help?

Error is:

An error has occurred in sub: main_activity_create (B4a line: 36) File.Copy (File.DirAssets, "mydatabase.dat", File.DirInternal, "mydatabase.dat" ) java.io.IOException Continue?

Thanks!
 
Top