I'm trying to enter to this folder using:
import os
location=os.chdir('/Applications')
for file in os.listdir(location):
print(file)
RETURN: 'Opesation not permitted'
When i run this, in the pythonista app, appears an alert message
But when alternately i run it but with the base root file directory, it pritns me all folders
import os
location=os.chdir('/')
for file in os.listdir(location):
print(file)
RETURN: .file .mb Applications Developer Library System bin cores dev etc private sbin tmp usr var
You cannot do it. source
For security purposes, an iOS app’s interactions with the file system are limited to the directories inside the app’s sandbox directory.
You should have access only to certain folders
During installation of a new app, the installer creates a number of container directories for the app inside the sandbox directory. Each container directory has a specific role.
This is your only working area
iOS apps always run in a sandbox