Type Method 型メソッド

fileHandleForReadingAtPath:

Returns a file handle initialized for reading the file, device, or named socket at the specified path. 指定されたパスでのファイル、デバイス、または名前付きソケットの読み込みのために初期化されるファイルハンドルを返します。

Declaration 宣言

+ (instancetype)fileHandleForReadingAtPath:(NSString *)path;

Parameters パラメータ

path

The path to the file, device, or named socket to access. アクセスするファイル、デバイス、または名前付きソケットへのパス。

Return Value 戻り値

The initialized file handle object or nil if no file exists at path. 初期化されたファイルハンドルオブジェクトまたは、pathでファイルが存在しないならばnil

Discussion 議論

The system sets the file pointer to the beginning of the file. You can’t write data to the returned file handle object. Use the readDataToEndOfFile or readDataOfLength: methods to read data from it. readDataToEndOfFileまたはreadDataOfLength:メソッドを使ってデータをそれから読み込んでください。

When using this method to create a file handle object, the file handle owns its associated file descriptor and is responsible for closing it. このメソッドを使ってファイルハンドルオブジェクトを作成する場合、ファイルハンドルは、それの結び付けられたファイル記述子を所有し、そしてそれを閉じることに責任を持ちます。

See Also 参照

Creating a File Handle ファイルハンドルを作成する

Related Documentation 関連文書