Copy Files Resource to Documents

I am copying the file from Resources to a folder in Documents but I can’t see the file after copying. Following it in the debugger it says it has been copied. What am I missing?

Var source As FolderItem
Var destination As FolderItem

// File inside Resources
source = SpecialFolder.Resource("Sample.bgcktext")

Var ASfolder As FolderItem = SpecialFolder.Documents.Child("BGCKData")

If ASfolder.exists = false then
  ASfolder.CreateFolder
End if

// Target location
destination = SpecialFolder.Documents.child("BGCKData").child("Sample.bgcktext")

If source <> Nil And source.Exists Then
  If Not destination.Exists Then
    source.CopyTo(destination)
  End If
End If

hi @Martin_Fitzgibbons

If you’re debugging it… where “destination” path points to? That would be a hint… :slight_smile:

1 Like

The documents folder is not visible to the user, if that’s what you are expecting.

1 Like

If you want to be able to see documents for your app when it is plugged into the mac, the app needs a plist entry, which I think is this one:

<key>UIFileSharingEnabled</key>  <true/>
1 Like