Instance Method インスタンスメソッド

matchesContentsOfURL:

Indicates whether the contents of a file wrapper matches a directory, regular file, or symbolic link on disk. ファイルラッパーの内容がディスク上のディレクトリ、通常ファイル、またはシンボリックリンクと合致するかどうかを指し示します。

Declaration 宣言

- (BOOL)matchesContentsOfURL:(NSURL *)url;

Parameters パラメータ

url

URL of the file-system node with which to compare the file wrapper. ファイルシステムノードのURL、それとファイルラッパーを比較します。

Return Value 戻り値

YES when the contents of the file wrapper match the contents of url, NO otherwise. YES、ファイルラッパーの内容がurlの内容と合致する場合は、そうでなければNO

Discussion 議論

The contents of files are not compared; matching of regular files is based on file modification dates. For a directory, children are compared against the files in the directory, recursively. ファイルの内容は比較されません;それら通常ファイルの一致は、ファイル修正日に基づきます。あるディレクトリに対して、子らがそのディレクトリの中のファイルに対して比較されます、再帰的に。

Because children of directory file wrappers are not read immediately by the initWithURL:options:error: method unless the NSFileWrapperReadingImmediate reading option is used, even a newly-created directory file wrapper might not have the same contents as the directory on disk. You can use this method to determine whether the file wrapper's contents in memory need to be updated. ディレクトリファイルラッパーの子らは直ぐにinitWithURL:options:error:メソッドによって読み出されることはNSFileWrapperReadingImmediate読み出しオプションが使われない限りはないことから、新しく作成されたディレクトリファイルラッパーでさえディスク上のディレクトリと同じ内容を持たないかもしれません。あなたは、このメソッドを使ってファイルラッパーの持つインメモリ内容が更新される必要があるかどうかを決定できます。

If the file wrapper needs updating, use the readFromURL:options:error: method with the NSFileWrapperReadingImmediate reading option. ファイルラッパーが更新を必要とするならば、readFromURL:options:error:メソッドをNSFileWrapperReadingImmediate読み出しオプションとともに使ってください。

This table describes which attributes of the file wrapper and file-system node are compared to determine whether the file wrapper matches the node on disk: この表は、ファイルラッパーがディスク上のノードと合致するかどうか決定するのに、ファイルラッパーとファイルシステムノードのどの属性が比較されるかを記述します。

File-wrapper type ファイルラッパー型

Comparison determinants 比較決定要素

Regular file 一般ファイル

Modification date and access permissions. 修正日とアクセス権。

Directory ディレクトリ

Children (recursive). 子ら(再帰的)。

Symbolic link シンボリックリンク

Destination pathname. 行き先パス名。

See Also 参照

Updating File Wrappers ファイルラッパーを更新する

Related Documentation 関連文書