metadataWrite(from:startingAt:length:)
Synchronously writes file system metadata from a buffer to the resource.
Declaration
func metadataWrite(from buffer: UnsafeRawBufferPointer, startingAt offset: off_t, length: Int) throwsParameters
- buffer:
A buffer to provide the data.
- offset:
The offset into the resource from which to start writing.
- length:
The number of bytes to writing.
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 write to succeed, requests must conform to any transfer requirements of the underlying resource. Disk drives typically require sector-addressed operations of one or more sector-aligned offsets, where a sector equals physicalBlockSize.
This method doesn’t support partial writing of metadata.