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

seekToEndReturningOffset:error:

Places the file pointer at the end of the file referenced by the file handle and returns the new file offset.

Declaration 宣言

- (BOOL)seekToEndReturningOffset:(out unsigned long long *)offsetInFile 
                           error:(out NSError * _Nullable *)error;

Parameters パラメータ

offsetInFile

When the return value is YES, this provides the file pointer’s offset at the end of the file. This should therefore equal to the size of the file.

error

When the return value is NO, this provides an NSError indicating why the operation failed.

Return Value 戻り値

Returns NO when there was an error. Otherwise, returns YES and sets the offsetInFile parameter’s pointee to the current position of the file pointer within the file.

Discussion 議論

Returns NO if called on a file handle representing a pipe or socket, or if the file descriptor is closed.

See Also 参照

Seeking Within a File ファイルの内部をシークする