我有一个带xfce窗口管理器的系统fedora 15。
我安装了一个inotify util来玩。
我想要控制,我的文件在我的工作过程中发生了什么。我今天使用一个命令来运行inotify。
inotifywait --fromfile ~/list.inotify该命令容易读取要读取和忽略的文件夹和文件列表。这是我的名单(list.inotify)
/home/alex
@/home/alex/Torrnets/
@/home/alex/.pulse-cookie因此,它应该读取我的主文件夹,忽略Torrent文件夹和.文件。
它也忽略了洪流。但它不会忽略一个.脉冲曲奇文件。
有什么解决办法吗?(请不要发布使用基于模式的忽略的解决方案,我想使用带有绝对路径的文件列表)
$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.发布于 2011-11-13 14:05:50
如果不指定-e参数,inotifywait将使用IN_ALL_EVENTS调用inotify_add_watch,这会导致被监视目录中的文件发生事件--注意inotify(7)说:
监视目录时,上面标记为星号(*)的事件可能发生在目录中的文件,在这种情况下,返回的inotify_event结构中的name字段标识目录中文件的名称。
如果您查看一下有问题的inotifywait等代码,您会发现它只监视(并根据排除列表检查)目录。如果您在指定一个非目录或从未使用的排除时受到警告,可能会对用户更友好一些,但这就是当前的情况。
https://stackoverflow.com/questions/8111835
复制相似问题