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

closeAndReturnError:

Disallows further access to the represented file or communications channel and signals end of file on communications channels that permit writing. 表現されたファイルまたは通信経路へのもっと先のアクセスを禁止します、そして書き込み許可する通信経路上のファイルの終端を合図します。

Declaration 宣言

- (BOOL)closeAndReturnError:(out NSError * _Nullable *)error;

Discussion 議論

If the file handle object owns its file descriptor, it automatically closes that descriptor when deallocated. If you initialized the file handle object using the initWithFileDescriptor: method, or you initialized it using the initWithFileDescriptor:closeOnDealloc: and passed NO for the flag parameter, you can use this method to close the file descriptor; otherwise, you must close the file descriptor yourself. あなたがファイルハンドルオブジェクトをinitWithFileDescriptor:メソッドを使って初期化したならば、またはあなたがそれをinitWithFileDescriptor:closeOnDealloc:を使って初期化したそしてNOflagパラメータに渡したならば、あなたはこのメソッドを使ってファイル記述子を閉じることができます;そうでなければ、あなたはファイル記述子をあなた自身で閉じなければなりません。

After calling this method, you may still use the file handle object, but you must not attempt to read or write data or use the object to operate on the file descriptor. Attempts to read or write a closed file descriptor raise an exception. 閉じられたファイル記述子での読み込みや書き出しの試みは、例外を引き起こします。

See Also 参照

Operating on a File ファイルに関する操作