Can I make a symbolic link of the file in File App?

Hi~

My app want to access a file in the File App. (Or import from the file app)
But I don't like to copy that file into my app. I prefer to link that file. (it save disk space)

So how can I make a symbolic link of the file in File App. and then save the link in my app.

Thanks!
Answered by DTS Engineer in 660413022

So how can I make a symbolic link of the file in File App.

You should use a security-scope bookmark for this. This has two functions:
  • Like a symlink, it maintains a reference to where the file is located [1].

  • Additionally, it stores the information necessary for you retain persistent access to the file. If you create a symlink to a file outside of your container, and then your app is terminated and relaunched, you lose access to that file. However, with a security-scoped bookmark you’re able to get that back.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

[1] It’s actually better than a symlink in this respect in that, depending on the exact setup, it may track the file if it’s moved or renamed.
Accepted Answer

So how can I make a symbolic link of the file in File App.

You should use a security-scope bookmark for this. This has two functions:
  • Like a symlink, it maintains a reference to where the file is located [1].

  • Additionally, it stores the information necessary for you retain persistent access to the file. If you create a symlink to a file outside of your container, and then your app is terminated and relaunched, you lose access to that file. However, with a security-scoped bookmark you’re able to get that back.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

[1] It’s actually better than a symlink in this respect in that, depending on the exact setup, it may track the file if it’s moved or renamed.
Very cool feature, thanks. I will try it.
Can I make a symbolic link of the file in File App?
 
 
Q