【问题标题】:Background file indexer (Win, *Nix, crossplatform)后台文件索引器(Win、*Nix、跨平台)
【发布时间】:2015-03-29 10:11:43
【问题描述】:

我正在构建一个等效于 OS X mds 守护进程或 mdworker 的后端,spotlight 在创建、删除和修改时使用 http://en.wikipedia.org/wiki/Spotlight_%28software%29 来索引文件(目录就是文件!)。

如此处所示,OS X 内核会通知“spotlight”它响应的任何更改 - https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/MetadataIntro/Concepts/HowDoesItWork.html#//apple_ref/doc/uid/TP40001847-CJBEJBHH

我正在为 Windows、*Nix/Linux 和 OS X 执行此操作。 是否有任何跨平台库提供钩子或这样做? 如果没有,您是否知道 Win32 API、Nix API、OS X API 的任何资源可以让我这样做?

我完全满足于只读访问和被拒绝访问系统敏感文件,但我能得到的越多越好!

这是桌面搜索引擎的列表,一些开源 - 如果你们中的任何人深入研究过代码,你知道他们是否以及在这种情况下如何管理它?例如,也许 Unity Dash 会这样做? http://en.wikipedia.org/wiki/List_of_search_engines#Desktop_search_engines

我对此事的调查正在这里继续:https://github.com/Centril/open-spotlight/wiki/Technical-in-depth#watcher

【问题讨论】:

    标签: c windows unix indexing filesystems


    【解决方案1】:

    我自己的研究发现了以下资源:

    http://en.wikipedia.org/wiki/File_Alteration_Monitor, NFS aware == great for network
    http://www.linuxdevcenter.com/pub/a/linux/2004/12/16/fam.html
    http://en.wikipedia.org/wiki/Inotify (Linux only)
    http://en.wikipedia.org/wiki/Gamin (Linux => Inotify, FreeBSD => kqueue)
    http://en.wikipedia.org/wiki/FSEvents (OS X > 10.7 (Lion), target >= Yosemite 10.10)
    http://en.wikipedia.org/wiki/Libevent (Platform Independent!)
    Even better: https://github.com/facebook/hhvm/issues/2047
    Winner: https://github.com/libuv/libuv, used by rust via libgreen.
    

    Libuv 似乎是一个很棒的库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-15
      • 1970-01-01
      • 2010-12-06
      相关资源
      最近更新 更多