Type Property 型プロパティ

forUploading

Specify this content when reading an item for the purpose of uploading its contents. ある項目をそれの内容をアップロードする目的のために読み出している場合にこの内容を指定してください。

Declaration 宣言

static var forUploading: NSFileCoordinator.ReadingOptions { get }

Discussion 議論

When this option is used, the file coordinator creates a temporary snapshot of the item being read and relinquishes its claim on the original file. This action prevents the read operation from blocking other coordinated writes during a potentially long upload. このオプションが使われる場合、ファイルコーディネータは読み出されている項目の一時的スナップショットを作成して、それの要求を元のファイル上で放棄します。この動作は、読み出し演算が他の協調書き出しを潜在的に長時間のアップロードの間に遮断するのを防止します。

If the item being read is a directory (such as a document package), then the snapshot is a new file containing the zipped contents of the directory. The URL passed to the accessor block points to the zipped file. 読み出されている項目がディレクトリ(例えばドキュメントパッケージ)ならば、そのときスナップショットはディレクトリのzipされた内容を含んでいる新しいファイルです。アクセッサブロックに渡されるURLは、zipされたファイルを指し示します。

When using this option, you may upload the document outside the accessor block. However, you should open a file descriptor to the file or relocate the file within the accessor block before doing so. The file coordinator unlinks the file after the block returns, rendering it inaccessible through the URL. このオプションを使っている場合、あなたは書類をアクセッサブロックの外側でアップロードするかもしれません。しかしながら、あなたはそのファイルへのファイル記述子を開くか、またはそうする前にそのファイルをアクセッサブロックの内側に再配置すべきです。ファイルコーディネータは、ブロックが返った後そのファイルをアンリンクして、そのURLを通してアクセスできない状態にします。