gpt4 book ai didi

macos - 如何检测文本文件是否仍被 TextEdit 打开

转载 作者:行者123 更新时间:2023-12-02 03:39:26 24 4
gpt4 key购买 nike

使用 lsof 我可以知道 docx 文件仍然被 Word 打开,但是如何检测文本文件(rtf、txt 等)仍然被 TextEdit 打开?

最佳答案

基于 this thread ,您可以尝试以下操作:

命令:

  • sudo  lsof -V  | grep [filename]
  • 这对我有用,但我必须在 TextEdit 打开它之前完成它:
    sudo  fs_usage | grep [filename]

  • 应用:
  • fseventer
  • Sloth

  • 打开Sloth后,它说这是由TextEdit打开的:
    ~/Library/Containers/com.apple.TextEdit/Data

    因此,您可以尝试的一件事是查看 TextEdit 是否在那里存储了任何数据:
  • sudo grep -R '[filename]' ~/"Library/Containers/com.apple.TextEdit/Data"
  • sudo grep -R [filename] ~/"Library/Containers/com.apple.TextEdit/Data/Library/Saved Application State"
  • 关于macos - 如何检测文本文件是否仍被 TextEdit 打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21040720/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com