I want to copy some files from DirAssets to DirInternal. Only files containing "old"'.
I always get a 'File not found' error.
B4X:
Dim HL As List
Dim F As String
HL = File.ListFiles(File.DirAssets)
For i = 0 To HL.Size-1
F = HL.Get(i)
If F.Contains("old") Then
File.Copy(File.DirAssets,F,File.DirInternal,F)
End If
Next
And I only want to copy this files when the app is installed. How do I do that?
I made a textfile containing all the files I want to copy (Dir /b >files.txt) and removed all the unwanted files.
Then copy this file to dir internal, fill the list (HL) and do the copy.
Only the first file in the list is copied. All the other files (150) generate a File Not Found error.
As suggested I do a log(F) before copying and I see no flaws in the filenames.
You should start a new thread for a new issue.
Make sure not to use Uppercased filenames as they are not supportet in Assets too. All must be lowercased
I made a textfile containing all the files I want to copy (Dir /b >files.txt) and removed all the unwanted files.
Then copy this file to dir internal, fill the list (HL) and do the copy.
Only the first file in the list is copied. All the other files (150) generate a File Not Found error.
As suggested I do a log(F) before copying and I see no flaws in the filenames.
Dim HL As List
Dim F As String
File.Copy(File.DirAssets,"files.txt",File.DirInternal,"files.txt")
HL = File.ReadList(File.DirInternal,"files.txt")
For i = 0 To HL.Size-1
Try
F = HL.Get(i)
Log(F)
File.Copy(File.DirAssets,F,File.DirInternal,F)
Catch
End Try
Next