translation:working:翻訳4

文書の過去の版を表示しています。


テクノロジー概要

ファイルシステムイベントAPIはOS X v10.5以降で利用可能な新しいテクノロジーです。 これにより、ディレクトリ階層やその内容に起因する、あらゆる変化の通知登録ができます。

ファイルシステムイベント機構は3つのパートで構成されます:生のイベント通知を(Spotlightも利用する)スペシャルデバイス経由でユーザー空間に渡すカーネルコード、この流れをフィルタにかけ通知を送出するデーモン、そして期間中の全ての変更の記録を保管する永続的なデータベースです。

アプリケーションが通知登録を行うと、ファイルシステムイベントデーモンは監視しているディレクトリ階層のファイルが変更される度に通知を発行します。 ディレクトリそのものが変更された場合(例えば、パーミッションの変更や新規ファイルの追加)も、同様に通知されます。 押さえるべき重要なポイントは、通知の粒度はディレクトリレベルだということです。 ディレクトリ内の何かが変わった事は伝わりますが、何が変わったかは伝わりません。

複数ファイルへの変更の通知はディレクトリ毎の1つの通知に折り畳まれる事に加え、ファイルシステムイベントデーモンはディレクトリで短時間に発生した複数の通知もまとめます。 最後の変更が行われた後で、あなたは常に最低でも1つの通知を受け取るでしょう。 その上で、荒くも細かくも、あなたが希望する一時的な粒度にできます。通知登録の際、イベント間隔として最小を選択することで。

To better understand this technology, you should first understand what it is not. It is not a mechanism for registering for fine-grained notification of filesystem changes. It was not intended for virus checkers or other technologies that need to immediately learn about changes to a file and preempt those changes if needed. The best way to support these is through a kernel extension that registers for interest in changes at the VFS level.

The file system events API is also not designed for finding out when a particular file changes. For such purposes, the kqueues mechanism is more appropriate.

The file system events API is designed for passively monitoring a large tree of files for changes. The most obvious use for this technology is for backup software. Indeed, the file system events API provides the foundation for Apple’s backup technology.

Another good use for the file system events API is providing consistency guarantees for applications that store data as a loose collection containing a project and dozens or hundreds of related files potentially scattered across the disk—DVD Studio Pro, for example. When one of the related files is modified by another application, your application needs to know about it so that it can choose how to incorporate the change into the project.

Of course, this use can also potentially be satisfied through the use of kqueues, but file system events provide the convenience of being able to see changes that occurred even while your application was not running, which can make consistency checking easier when your application opens a project initially.

  • translation/working/翻訳4.1461242817.txt.gz
  • 最終更新: 2016-04-21 21:46
  • by Decomo