iOS Question file.setexcludefromBackup folder

AndOrNot

Well-Known Member
Licensed User
Hi all, if i use file.SetExcludefromBackup on a folder like code below it will works? I know that i should to create a cache folder in file.dirlibrary, but this mean that i must to replace many codelines.. Thanks all

B4X:
file.SetExcludeFromBackup(File.DirLibrary,"Audio",true)
 

Erel

Administrator
Staff member
Licensed User
Upvote 0

AndOrNot

Well-Known Member
Licensed User
Based on the answer here: http://stackoverflow.com/questions/14376883/is-nsurlisexcludedfrombackupkey-recursive it will work.

You can easily set this flag to all files in the folder (not recursive):
B4X:
Dim dir As String = File.Combine(File.DirLibrary, "Audio")
For Each f As String In File.ListFiles(dir)
File.SetExcludeFromBackup(dir, f, True)
Next
Thanks to reply. If i have more than 1 folder, is possible to do this:

B4X:
For Each f As String In File.ListFiles(file.dirlibrary)
File.SetExcludeFromBackup(dir, f, True)
Next


Edit: sorry, I didn't read "not recursive"
 
Last edited:
Upvote 0
Top