Contents

metadataReadInto:startingAt:length:error:

Synchronously reads file system metadata from the resource into a buffer.

Declaration

- (BOOL) metadataReadInto:(void *) buffer startingAt:(off_t) offset length:(size_t) length error:(NSError **) error;

Parameters

  • buffer:

    A buffer to receive the data.

  • offset:

    The offset into the resource from which to start reading.

  • length:

    The number of bytes to read.

  • error:

    On return, any error encountered while reading data, or nil if no error occurred.

Return Value

A Boolean value indicating whether the metadata read succeeded.

Discussion

This method provides access to the Kernel Buffer Cache, which is the primary system cache for file system metadata. Unlike equivalent kernel APIs, this method doesn’t hold any kernel-level claim to the underlying buffers.

For the read to succeed, requests must conform to any transfer requirements of the underlying resource. Disk drives typically require sector (physicalBlockSize) addressed operations of one or more sector-aligned offsets.

This method doesn’t support partial reading of metadata.

See Also

Reading and writing data with kernel buffer cache