Rice Tyler
Rice Tyler

Reputation: 131

Unable to modify permissions of folders on Mac (Mojave)

I am new to Macs and I am trying to run some interesting stats on my iMessages using the code runner extension on VSCode. I've been following this post: https://towardsdatascience.com/heres-how-you-can-access-your-entire-imessage-history-on-your-mac-f8878276c6e9

However, when I run the line conn = sqlite3.connect('/Users/<username>/Library/Messages/chat.db') I get the error sqlite3.OperationalError: unable to open database file

Based off what I can tell my issue is that VScode doesn't have the right permissions to access the ~/Library/Messages folder and possibly the chat.db as well. First, I ran ls -l on Library and the result is drwx---rwx for Messages. So I tried to use both chmod a+rwx Messages and sudo chmod a+rwx Messages to open permissions to everything but got the error chmod: Unable to change file mode on Messages: Operation not permitted both times. Am I doing something wrong and/or is there a better way to do this? Or is it just not possible to change the permissions of this folder?

Upvotes: 3

Views: 6893

Answers (1)

Rice Tyler
Rice Tyler

Reputation: 131

After some more creative searching I discovered that it was an Issue with Mojave's System Integrity Protection (SIP) and can be solved by giving the desired apps full disk access in Settings>Security&Privacy>Privacy>FullDiskAccess.

Solution found here

Upvotes: 6

Related Questions