首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >inotify -fromfile文件指令

inotify -fromfile文件指令
EN

Stack Overflow用户
提问于 2011-11-13 13:24:18
回答 1查看 1.6K关注 0票数 1

我有一个带xfce窗口管理器的系统fedora 15。

我安装了一个inotify util来玩。

我想要控制,我的文件在我的工作过程中发生了什么。我今天使用一个命令来运行inotify。

代码语言:javascript
复制
inotifywait --fromfile ~/list.inotify

该命令容易读取要读取和忽略的文件夹和文件列表。这是我的名单(list.inotify)

代码语言:javascript
复制
/home/alex

@/home/alex/Torrnets/
@/home/alex/.pulse-cookie

因此,它应该读取我的主文件夹,忽略Torrent文件夹和.文件。

它也忽略了洪流。但它不会忽略一个.脉冲曲奇文件。

有什么解决办法吗?(请不要发布使用基于模式的忽略的解决方案,我想使用带有绝对路径的文件列表)

代码语言:javascript
复制
$man inotify
   @<file>
          When watching a directory tree recursively, exclude the specified file from being watched.  The file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories.  If a  specific
          path is explicitly both included and excluded, it will always be watched.

          Note: If you need to watch a directory or file whose name starts with @, give the absolute path.

   --fromfile <file>
          Read filenames to watch or exclude from a file, one filename per line.  If filenames begin with @ they are excluded as described above.  If <file> is `-', filenames are read from standard input.  Use this option if you need to watch too many files to
          pass in as command line arguments.
EN

回答 1

Stack Overflow用户

发布于 2011-11-13 14:05:50

如果不指定-e参数,inotifywait将使用IN_ALL_EVENTS调用inotify_add_watch,这会导致被监视目录中的文件发生事件--注意inotify(7)说:

监视目录时,上面标记为星号(*)的事件可能发生在目录中的文件,在这种情况下,返回的inotify_event结构中的name字段标识目录中文件的名称。

如果您查看一下有问题的inotifywait等代码,您会发现它只监视(并根据排除列表检查)目录。如果您在指定一个非目录或从未使用的排除时受到警告,可能会对用户更友好一些,但这就是当前的情况。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8111835

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档