I am having a self compiled binary in my sandboxed application. On user request I run the command. It tries to create a file on a volume and fails with permission denied.
The app is sandboxed and a security scope bookmark for file:/// is created and valid. When run from terminal the command works, sudo is not necessary.
let task = Process()
task.launchPath = Bundle.main.url(forResource: "f3write", withExtension: nil)
task.arguments = ["/Volume/SDCard"]
task.launch()
I am piping the commands output:
Free space: 28.64 GB
Creating file 1.h2w ...
f3write: Can't create file /Volumes/SDCard/1.h2w: Operation not permitted