Errno 1 Операция не разрешена. Но у файла есть полные права? - PullRequest
0 голосов
/ 05 августа 2020

Выполнение проекта, который я переработал, чтобы включить базу данных Sqlite. Раньше не было проблем с доступом, чтением и записью файлов с помощью pickle, в том же каталоге и даже в других каталогах root внутри программных файлов. Но теперь, после переделки, я вытаскиваю Errno1, говоря мне, что

conn = sqlite3.connect(dataBase)
OperationalError: unable to open database file

Full permissions

So I checked permissions like everyone recommended, and I have full permission for the file. Unable to figure it out I created a test.txt file to see if I could open that file from my console.

PermissionError: [Errno 1] Operation not permitted: /Users/daniel/Documents/PROJECTS/DANTRON/DATA_LOG/CONTROL_DATABASE/test.txt

Again checked permissions and I have full permissions. Even added both read and write permissions to admin and everyone, just to be sure. Still unable to open the file and still getting an Errno 1.

Full permission on test.txt

I tried changing the permissions via the terminal, and checked the groups and noticed something odd. Someone mentioned it is normal to see a group with the same name as the user, but I found a lot of groups but none with my user name. Don't know if this is meaningful. Tried chown, and it still isn't allowing me.

enter image description here

How can I figure this out?

UPDATE:

So I used

os.getcwd()

to find the working directory of the terminal, and tried to open a file within the same working directory, and I was successful. Seems to me the problem is that I can't open any files that are not in my current working directory. I've never had this problem in the past with python, and don't remember ever having to make adjustments to access files outside of the current working directory.

Невозможно открывать файлы вне Dir

Кто-нибудь есть идеи, как я могу решить эту проблему?

1 Ответ

0 голосов
/ 05 августа 2020

может быть причина в ICloud Drive? Попробуйте папку за пределами области действия ICloud Drive ....

...