macos - 无法在 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---rwx
Messages。因此,我尝试同时使用两者chmod a+rwx Messages
并sudo chmod a+rwx Messages
打开所有内容的权限,但chmod: Unable to change file mode on Messages: Operation not permitted
两次都出现错误。我做错了什么和/或有更好的方法吗?还是无法更改此文件夹的权限?
解决方案
经过一些更有创意的搜索后,我发现这是 Mojave 的系统完整性保护 (SIP) 的一个问题,可以通过在设置>安全和隐私>隐私>FullDiskAccess 中为所需的应用程序提供全盘访问来解决。
推荐阅读
- javascript - Puppeteer - 如何使用 XPath 获取标签的长度?
- sql - 如何使用 Select Query 更新前 (20) 条记录
- javascript - 如何运行我 git 克隆的程序?
- laravel - Http 异常 Laravel 5.6
- linux - expr:Cygwin 中的非整数参数错误
- sql - PostgreSQL 是否保证两个同时提交的“提交时间戳”的唯一性?
- javascript - 在另一个不工作的内部返回一个承诺
- json - 以逗号分隔的字符串 JSON 中的转义引号
- sql - 从现有查询返回结果的过程
- css - 如何使用 Flexbox 将第二行包装的卡片与第一行对齐?