Sub CopyTest
Dim i As Int
Dim strFolder As String
Dim strFileName As String
strFolder = "PhonePats"
strFileName = "PhonePatsE.db"
File.Delete(File.DirInternal, "PhonePatsE.db")
Dim lst As List
lst = File.ListFiles(File.DirInternal)
For i = 0 To lst.Size - 1
Log(i & " - " & lst.Get(i))
Next
Dim extFolder As ExternalFile = Storage.FindFile(Storage.Root, strFolder)
Log("Folder found: " & extFolder.IsInitialized & ", extFolder.Name: " & extFolder.Name)
If extFolder.IsInitialized Then
Dim extFile As ExternalFile = Storage.FindFile(extFolder, strFileName)
Log("File found: " & extFile.IsInitialized & ", extFile.Name: " & extFile.Name)
If extFile.IsInitialized Then
Dim out As OutputStream = File.OpenOutput(File.DirInternal, strFileName, False)
File.Copy2(Storage.OpenInputStream(extFile), out)
out.Close
End If
End If
Dim lst As List
lst = File.ListFiles(File.DirInternal)
For i = 0 To lst.Size - 1
Log(i & " - " & lst.Get(i)) 'PhonePatsE.db is there
Next
Log("File.Exists: " & File.Exists(File.DirInternal, strFileName)) '>> True
End Sub