首页 > 解决方案 > 无法在 Mac (Mojave) 上修改文件夹的权限

问题描述

我是 Mac 的新手,我正在尝试使用 VSCode 上的代码运行器扩展在我的 iMessage 上运行一些有趣的统计数据。我一直在关注这篇文章:https ://towardsdatascience.com/heres-how-you-can-access-your-entire-imessage-history-on-your-mac-f8878276c6e9

但是,当我运行该行时,conn = sqlite3.connect('/Users/<username>/Library/Messages/chat.db') 我得到了错误sqlite3.OperationalError: unable to open database file

根据我可以告诉我的问题,VScode 没有正确的权限来访问 ~/Library/Messages 文件夹,也可能是 chat.db。首先,我ls -l在 Library 上运行,结果是drwx---rwxMessages。因此,我尝试同时使用两者chmod a+rwx Messagessudo chmod a+rwx Messages打开所有内容的权限,但chmod: Unable to change file mode on Messages: Operation not permitted两次都出现错误。我做错了什么和/或有更好的方法吗?还是无法更改此文件夹的权限?

标签: macospermissionschmodmacos-mojave

解决方案


经过一些更有创意的搜索后,我发现这是 Mojave 的系统完整性保护 (SIP) 的一个问题,可以通过在设置>安全和隐私>隐私>FullDiskAccess 中为所需的应用程序提供全盘访问来解决。

在这里找到的解决方案


推荐阅读