fskit

package
v0.6.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package fskit provides Go bindings for the FSKit framework.

Implement a file system that runs in user space.

With FSKit, you can extend macOS by enabling access to new types of file systems. You do this by developing an FSKit module ([FSModule]), which you deliver as an app extension that runs in user space, and is compatible with Mac App Store distribution. FSKit connects your module to the system’s existing frameworks and tools, like Disk Arbitration, NetFS, and the `mount(8)` command.

File systems

Containers

Resources

Volumes

Items

  • FSItem: A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.

Maintenance and management

Operations

Tasks

  • FSTask: A class that enables a file system module to pass log messages and completion notifications to clients.
  • FSTaskOptions: A class that passes command options to a task, optionally providing security-scoped URLs.

Errors and logging

FSKit interactions

Utilities

Supporting types

Macros

  • FSKIT_API_AVAILABILITY_V1
  • FSKIT_API_UNAVAILABLE_V1
  • FS_ALWAYS_EXPORT
  • FS_EXPORT
  • FS_EXPORT_INTERNAL
  • FS_EXTERN
  • FS_SUPPORTED_VISIBILITY
  • FSKIT_API_AVAILABILITY_V2
  • FSKIT_API_AVAILABILITY_V2_4

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// FSKitErrorDomain is an error domain for FSKit errors.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSKitErrorDomain
	FSKitErrorDomain foundation.NSErrorDomain
)
View Source
var (
	// FSKitVersionNumber is project version number for FSKit.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSKitVersionNumber
	FSKitVersionNumber float64
)
View Source
var (
	// FSKitVersionString is project version string for FSKit.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSKitVersionString
	FSKitVersionString uint8
)

Functions

func Fs_errorForCocoaError

func Fs_errorForCocoaError(errorCode int) *foundation.NSError

Fs_errorForCocoaError creates an error object for the given Cocoa error code.

See: https://developer.apple.com/documentation/FSKit/fs_errorForCocoaError(_:)

func Fs_errorForMachError

func Fs_errorForMachError(errorCode int) *foundation.NSError

Fs_errorForMachError creates an error object for the given Mach error code.

See: https://developer.apple.com/documentation/FSKit/fs_errorForMachError(_:)

func Fs_errorForPOSIXError

func Fs_errorForPOSIXError(arg0 int) *foundation.NSError

Fs_errorForPOSIXError creates an error object for the given POSIX error code.

See: https://developer.apple.com/documentation/FSKit/fs_errorForPOSIXError(_:)

func NewBoolErrorBlock

func NewBoolErrorBlock(handler BoolErrorHandler) (objc.ID, func())

NewBoolErrorBlock wraps a Go BoolErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeAccessCheckOperations.CheckAccessToItemRequestedAccessReplyHandler]

func NewDataErrorBlock

func NewDataErrorBlock(handler DataErrorHandler) (objc.ID, func())

NewDataErrorBlock wraps a Go DataErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeXattrOperations.GetXattrNamedOfItemReplyHandler]

func NewErrorBlock

func NewErrorBlock(handler ErrorHandler) (objc.ID, func())

NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • FSFileSystem.WipeResourceCompletionHandler
  • [FSFileSystemBase.WipeResourceCompletionHandler]
  • FSUnaryFileSystem.WipeResourceCompletionHandler
  • [FSUnaryFileSystemOperations.UnloadResourceOptionsReplyHandler]
  • [FSVolumeItemDeactivation.DeactivateItemReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler]
  • [FSVolumeOpenCloseOperations.CloseItemKeepingModesReplyHandler]
  • [FSVolumeOpenCloseOperations.OpenItemWithModesReplyHandler]
  • [FSVolumeOperations.DeactivateWithOptionsReplyHandler]
  • [FSVolumeOperations.MountWithOptionsReplyHandler]
  • [FSVolumeOperations.ReclaimItemReplyHandler]
  • [FSVolumeOperations.RemoveItemNamedFromDirectoryReplyHandler]
  • [FSVolumeOperations.SynchronizeWithFlagsReplyHandler]
  • [FSVolumeXattrOperations.SetXattrNamedToDataOnItemPolicyReplyHandler]

func NewFSDirectoryVerifierErrorBlock

func NewFSDirectoryVerifierErrorBlock(handler FSDirectoryVerifierErrorHandler) (objc.ID, func())

NewFSDirectoryVerifierErrorBlock wraps a Go FSDirectoryVerifierErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeOperations.EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler]

func NewFSFileNameArrayErrorBlock added in v0.6.10

func NewFSFileNameArrayErrorBlock(handler FSFileNameArrayErrorHandler) (objc.ID, func())

NewFSFileNameArrayErrorBlock wraps a Go FSFileNameArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeXattrOperations.ListXattrsOfItemReplyHandler]

func NewFSFileNameErrorBlock

func NewFSFileNameErrorBlock(handler FSFileNameErrorHandler) (objc.ID, func())

NewFSFileNameErrorBlock wraps a Go FSFileNameErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeOperations.CreateLinkToItemNamedInDirectoryReplyHandler]
  • [FSVolumeOperations.ReadSymbolicLinkReplyHandler]
  • [FSVolumeOperations.RenameItemInDirectoryNamedToNewNameInDirectoryOverItemReplyHandler]
  • [FSVolumeRenameOperations.SetVolumeNameReplyHandler]

func NewFSItemAttributesErrorBlock

func NewFSItemAttributesErrorBlock(handler FSItemAttributesErrorHandler) (objc.ID, func())

NewFSItemAttributesErrorBlock wraps a Go FSItemAttributesErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeOperations.GetAttributesOfItemReplyHandler]
  • [FSVolumeOperations.SetAttributesOnItemReplyHandler]

func NewFSItemErrorBlock

func NewFSItemErrorBlock(handler FSItemErrorHandler) (objc.ID, func())

NewFSItemErrorBlock wraps a Go FSItemErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeOperations.ActivateWithOptionsReplyHandler]

func NewFSItemFSFileNameErrorBlock

func NewFSItemFSFileNameErrorBlock(handler FSItemFSFileNameErrorHandler) (objc.ID, func())

NewFSItemFSFileNameErrorBlock wraps a Go FSItemFSFileNameErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeKernelOffloadedIOOperations.CreateFileNamedInDirectoryAttributesPackerReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.LookupItemNamedInDirectoryPackerReplyHandler]
  • [FSVolumeOperations.CreateItemNamedTypeInDirectoryAttributesReplyHandler]
  • [FSVolumeOperations.CreateSymbolicLinkNamedInDirectoryAttributesLinkContentsReplyHandler]
  • [FSVolumeOperations.LookupItemNamedInDirectoryReplyHandler]

func NewFSModuleIdentityArrayErrorBlock added in v0.6.10

func NewFSModuleIdentityArrayErrorBlock(handler FSModuleIdentityArrayErrorHandler) (objc.ID, func())

NewFSModuleIdentityArrayErrorBlock wraps a Go FSModuleIdentityArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewFSProbeResultErrorBlock

func NewFSProbeResultErrorBlock(handler FSProbeResultErrorHandler) (objc.ID, func())

NewFSProbeResultErrorBlock wraps a Go FSProbeResultErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSUnaryFileSystemOperations.ProbeResourceReplyHandler]

func NewFSVolumeErrorBlock

func NewFSVolumeErrorBlock(handler FSVolumeErrorHandler) (objc.ID, func())

NewFSVolumeErrorBlock wraps a Go FSVolumeErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSUnaryFileSystemOperations.LoadResourceOptionsReplyHandler]

func NewVoidBlock

func NewVoidBlock(handler VoidHandler) (objc.ID, func())

NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [FSVolumeOperations.UnmountWithReplyHandler]

func Newsize_tErrorBlock

func Newsize_tErrorBlock(handler size_tErrorHandler) (objc.ID, func())

Newsize_tErrorBlock wraps a Go [size_tErrorHandler] as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

Types

type BoolErrorHandler

type BoolErrorHandler = func(bool, error)

BoolErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeAccessCheckOperations.CheckAccessToItemRequestedAccessReplyHandler]

type DataErrorHandler

type DataErrorHandler = func(*foundation.NSData, error)

DataErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeXattrOperations.GetXattrNamedOfItemReplyHandler]

type ErrorHandler

type ErrorHandler = func(error)

ErrorHandler handles A block or closure that executes after the wipe operation completes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • FSFileSystem.WipeResourceCompletionHandler
  • [FSFileSystemBase.WipeResourceCompletionHandler]
  • FSUnaryFileSystem.WipeResourceCompletionHandler
  • [FSUnaryFileSystemOperations.UnloadResourceOptionsReplyHandler]
  • [FSVolumeItemDeactivation.DeactivateItemReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler]
  • [FSVolumeOpenCloseOperations.CloseItemKeepingModesReplyHandler]
  • [FSVolumeOpenCloseOperations.OpenItemWithModesReplyHandler]
  • [FSVolumeOperations.DeactivateWithOptionsReplyHandler]
  • [FSVolumeOperations.MountWithOptionsReplyHandler]
  • [FSVolumeOperations.ReclaimItemReplyHandler]
  • [FSVolumeOperations.RemoveItemNamedFromDirectoryReplyHandler]
  • [FSVolumeOperations.SynchronizeWithFlagsReplyHandler]
  • [FSVolumeXattrOperations.SetXattrNamedToDataOnItemPolicyReplyHandler]

type FSAccessMask

type FSAccessMask uint

See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessMask

const (
	// FSAccessAddFile: The file system allows adding files.
	FSAccessAddFile FSAccessMask = 4
	// FSAccessAddSubdirectory: The file system allows adding subdirectories.
	FSAccessAddSubdirectory FSAccessMask = 32
	// FSAccessAppendData: The file system allows appending data to a file.
	FSAccessAppendData FSAccessMask = 32
	// FSAccessDelete: The file system allows deleting a file.
	FSAccessDelete FSAccessMask = 16
	// FSAccessDeleteChild: The file system allows deleting subdirectories.
	FSAccessDeleteChild FSAccessMask = 64
	// FSAccessExecute: The file system allows file executuion.
	FSAccessExecute FSAccessMask = 8
	// FSAccessListDirectory: The file system allows listing directory contents.
	FSAccessListDirectory FSAccessMask = 2
	// FSAccessReadAttributes: The file system allows reading file attributes.
	FSAccessReadAttributes FSAccessMask = 128
	// FSAccessReadData: The file system allows reading data.
	FSAccessReadData FSAccessMask = 2
	// FSAccessReadSecurity: The file system allows reading a file’s security descriptors.
	FSAccessReadSecurity FSAccessMask = 2048
	// FSAccessReadXattr: The file system allows reading extended file attributes.
	FSAccessReadXattr FSAccessMask = 512
	// FSAccessSearch: The file system allows searching files.
	FSAccessSearch FSAccessMask = 8
	// FSAccessTakeOwnership: The file system allows taking ownership of a file.
	FSAccessTakeOwnership FSAccessMask = 8192
	// FSAccessWriteAttributes: The file system allows writing file attributes.
	FSAccessWriteAttributes FSAccessMask = 256
	// FSAccessWriteData: The file system allows writing data.
	FSAccessWriteData FSAccessMask = 4
	// FSAccessWriteSecurity: The file system allows writing a file’s security descriptors.
	FSAccessWriteSecurity FSAccessMask = 4096
	// FSAccessWriteXattr: The file system allows writing extended file attributes.
	FSAccessWriteXattr FSAccessMask = 1024
)

func (FSAccessMask) String

func (e FSAccessMask) String() string

type FSBlockDeviceResource

type FSBlockDeviceResource struct {
	FSResource
}

A resource that represents a block storage disk partition.

Overview

A FSBlockDeviceResource can exist in either a proxied or nonproxied version. Only the `fskitd` daemon creates “real” (nonproxied) instances of this class. Client applications and daemons create proxy objects for requests, and `fskitd` opens the underlying device during the processing of the request.

This class wraps a file descriptor for a disk device or partition. Its fundamental identifier is the BSD disk name (FSBlockDeviceResource.BSDName) for the underlying IOMedia object. However, FSBlockDeviceResource doesn’t expose the underlying file descriptor. Instead, it provides accessor methods that can read from and write to the partition, either directly or using the kernel buffer cache.

When you use a FSBlockDeviceResource, your file system implementation also conforms to a maintenance operation protocol. These protocols add support for checking, repairing, and optionally formatting file systems. The system doesn’t mount block device file systems until they pass a file system check. For an FSUnaryFileSystem that uses FSBlockDeviceResource, conform to FSManageableResourceMaintenanceOperations.

Accessing resource properties

Reading and writing data with kernel buffer cache

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource

func FSBlockDeviceResourceFromID

func FSBlockDeviceResourceFromID(id objc.ID) FSBlockDeviceResource

FSBlockDeviceResourceFromID constructs a FSBlockDeviceResource from an objc.ID.

A resource that represents a block storage disk partition.

func NewFSBlockDeviceResource

func NewFSBlockDeviceResource() FSBlockDeviceResource

NewFSBlockDeviceResource creates a new FSBlockDeviceResource instance.

func (FSBlockDeviceResource) AsynchronousMetadataFlushWithError

func (b FSBlockDeviceResource) AsynchronousMetadataFlushWithError() (bool, error)

Asynchronously flushes the resource’s buffer cache.

Discussion

This method schedules a flush of data previously written with FSBlockDeviceResource.DelayedMetadataWriteFromStartingAtLengthError to the resource and returns immediately without blocking. This method doesn’t wait to check the flush’s status. If an error prevents the flush from being scheduled, the error is indicated by the in-out `error` parameter.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/asynchronousMetadataFlush()

func (FSBlockDeviceResource) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSBlockDeviceResource) BSDName

func (b FSBlockDeviceResource) BSDName() string

The device name of the resource.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/bsdName

func (FSBlockDeviceResource) BlockCount

func (b FSBlockDeviceResource) BlockCount() uint64

The block count on this resource.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/blockCount

func (FSBlockDeviceResource) BlockSize

func (b FSBlockDeviceResource) BlockSize() uint64

The logical block size, the size of data blocks used by the file system.

Discussion

This is equivalent to the [DKIOCGETBLOCKSIZE] device parameter.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/blockSize

func (FSBlockDeviceResource) DelayedMetadataWriteFromStartingAtLengthError

func (b FSBlockDeviceResource) DelayedMetadataWriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)

Writes file system metadata from a buffer to a cache, prior to flushing it to the resource.

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.

error: On return, any error encountered while writing data, or `nil` if no error occurred.

Return Value

A Boolean value indicating whether the metadata write 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.

This method is equivalent to FSBlockDeviceResource.MetadataWriteFromStartingAtLengthError, except that it writes data to the resource’s buffer cache instead of writing to disk immediately. To ensure writing data to disk, the client must flush the metadata by calling FSBlockDeviceResource.MetadataFlushWithError or FSBlockDeviceResource.AsynchronousMetadataFlushWithError.

Delayed writes offer two significant advantages:

- Delayed writes are more performant, since the file system can avoid waiting for the actual write, reducing I/O latency. - When writing to a specific range repeatedly, delayed writes allow the file system to flush data to the disk only when necessary. This reduces disk usage by eliminating unnecessary writes.

For the write 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 writing of metadata.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/delayedMetadataWriteFrom:startingAt:length:error:

func (FSBlockDeviceResource) Init

Init initializes the instance.

func (FSBlockDeviceResource) IsWritable added in v0.6.5

func (b FSBlockDeviceResource) IsWritable() bool

A Boolean property that indicates whether the resource can write data to the device.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/isWritable

func (FSBlockDeviceResource) MetadataClearWithDelayedWritesError

func (b FSBlockDeviceResource) MetadataClearWithDelayedWritesError(rangesToClear []FSMetadataRange, withDelayedWrites bool) (bool, error)

Clears the given ranges within the buffer cache.

rangesToClear: The metadata ranges to clear.

withDelayedWrites: A Boolean value that determines whether to perform the clear operation with delayed writes. The delay works in the same manner as FSBlockDeviceResource.DelayedMetadataWriteFromStartingAtLengthError. When using delayed writes, the client can flush the metadata with FSBlockDeviceResource.MetadataFlushWithError or FSBlockDeviceResource.AsynchronousMetadataFlushWithError. The system also flushes stale data in the buffer cache periodically.

Discussion

This method clears the specified ranges in the resource’s buffer cache by writing zeroes into them.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/metadataClear(_:withDelayedWrites:)

func (FSBlockDeviceResource) MetadataFlushWithError

func (b FSBlockDeviceResource) MetadataFlushWithError() (bool, error)

Synchronously flushes the resource’s buffer cache.

Discussion

This method flushes data previously written with FSBlockDeviceResource.DelayedMetadataWriteFromStartingAtLengthError to the resource.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/metadataFlush()

func (FSBlockDeviceResource) MetadataPurgeError

func (b FSBlockDeviceResource) MetadataPurgeError(rangesToPurge []FSMetadataRange) (bool, error)

Synchronously purges the given ranges from the buffer cache.

rangesToPurge: The metadata ranges to purge.

Discussion

This method removes the given ranges from the resource’s buffer cache. This process drops any dirty data in the cache, preventing the data from reaching the device.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/metadataPurge(_:)

func (FSBlockDeviceResource) MetadataReadIntoStartingAtLengthError

func (b FSBlockDeviceResource) MetadataReadIntoStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)

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

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: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/metadataReadInto:startingAt:length:error:

func (FSBlockDeviceResource) MetadataWriteFromStartingAtLengthError

func (b FSBlockDeviceResource) MetadataWriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)

Synchronously writes file system metadata from a buffer to the resource.

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.

error: On return, any error encountered while writing data, or `nil` if no error occurred.

Return Value

A Boolean value indicating whether the metadata write 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 write 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 writing of metadata.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/metadataWriteFrom:startingAt:length:error:

func (FSBlockDeviceResource) PhysicalBlockSize

func (b FSBlockDeviceResource) PhysicalBlockSize() uint64

The sector size of the device.

Discussion

This is equivalent to the [DKIOCGETPHYSICALBLOCKSIZE] device parameter.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/physicalBlockSize

func (FSBlockDeviceResource) ReadIntoStartingAtLength

func (b FSBlockDeviceResource) ReadIntoStartingAtLength(ctx context.Context, buffer unsafe.Pointer, offset int64, length uintptr) (uintptr, error)

ReadIntoStartingAtLength is a synchronous wrapper around FSBlockDeviceResource.ReadIntoStartingAtLengthCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (FSBlockDeviceResource) ReadIntoStartingAtLengthCompletionHandler

func (b FSBlockDeviceResource) ReadIntoStartingAtLengthCompletionHandler(buffer unsafe.Pointer, offset int64, length uintptr, completionHandler size_tErrorHandler)

Reads data from the resource into a buffer and executes a block afterwards.

buffer: A buffer to receive the data.

offset: The offset into the resource from which to start reading.

length: A maximum number of bytes to read. The completion handler receives a parameter with the actual number of bytes read.

completionHandler: A block that executes after the read operation completes. If successful, the first parameter contains the number of bytes actually read. In the case of an error, the second parameter contains a non-`nil` error. This value is [EFAULT] if `buffer` is [NULL], or `errno` if reading from the resource failed.

Discussion

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.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/readInto:startingAt:length:completionHandler:

func (FSBlockDeviceResource) ReadIntoStartingAtLengthError

func (b FSBlockDeviceResource) ReadIntoStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (uintptr, error)

Synchronously reads data from the resource into a buffer.

buffer: A buffer to receive the data.

offset: The offset into the resource from which to start reading.

length: A maximum number of bytes to read. The method’s return value contains the actual number of bytes read.

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

Return Value

The actual number of bytes read.

Discussion

This is a synchronous version of FSBlockDeviceResource.ReadIntoStartingAtLengthCompletionHandler.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/readInto:startingAt:length:error:

func (FSBlockDeviceResource) WriteFromStartingAtLength

func (b FSBlockDeviceResource) WriteFromStartingAtLength(ctx context.Context, buffer unsafe.Pointer, offset int64, length uintptr) (uintptr, error)

WriteFromStartingAtLength is a synchronous wrapper around FSBlockDeviceResource.WriteFromStartingAtLengthCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (FSBlockDeviceResource) WriteFromStartingAtLengthCompletionHandler

func (b FSBlockDeviceResource) WriteFromStartingAtLengthCompletionHandler(buffer unsafe.Pointer, offset int64, length uintptr, completionHandler size_tErrorHandler)

Writes data from from a buffer to the resource and executes a block afterwards.

buffer: A buffer to provide the data.

offset: The offset into the resource from which to start writing.

length: A maximum number of bytes to write. The completion handler receives a parameter with the actual number of bytes write.

completionHandler: A block that executes after the write operation completes. If successful, the first parameter contains the number of bytes actually written. In the case of an error, the second parameter contains a non-`nil` error. This value is [EFAULT] if `buffer` is [NULL], or `errno` if writing to the resource failed.

Discussion

For the write 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.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/writeFrom:startingAt:length:completionHandler:

func (FSBlockDeviceResource) WriteFromStartingAtLengthError

func (b FSBlockDeviceResource) WriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (uintptr, error)

Synchronously writes data from from a buffer to the resource and executes a block afterwards.

buffer: A buffer to provide the data.

offset: The offset into the resource from which to start writing.

length: A maximum number of bytes to write. The completion handler receives a parameter with the actual number of bytes write.

error: On return, any error encountered while writing data, or `nil` if no error occurred.

Return Value

The actual number of bytes written.

Discussion

This is a synchronous version of FSBlockDeviceResource.WriteFromStartingAtLengthCompletionHandler.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource/writeFrom:startingAt:length:error:

type FSBlockDeviceResourceClass

type FSBlockDeviceResourceClass struct {
	// contains filtered or unexported fields
}

func GetFSBlockDeviceResourceClass

func GetFSBlockDeviceResourceClass() FSBlockDeviceResourceClass

GetFSBlockDeviceResourceClass returns the class object for FSBlockDeviceResource.

func (FSBlockDeviceResourceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSBlockDeviceResourceClass) Class

Class returns the underlying Objective-C class pointer.

type FSBlockmapFlags

type FSBlockmapFlags uint

See: https://developer.apple.com/documentation/FSKit/FSBlockmapFlags

const (
	// FSBlockmapFlagsRead: A flag that describes a read operation.
	FSBlockmapFlagsRead FSBlockmapFlags = 0x100
	// FSBlockmapFlagsWrite: A flag that describes a write operation.
	FSBlockmapFlagsWrite FSBlockmapFlags = 0x200
)

func (FSBlockmapFlags) String

func (e FSBlockmapFlags) String() string

type FSClient

type FSClient struct {
	objectivec.Object
}

An interface for apps and daemons to interact with FSKit.

Overview

FSClient is the primary management interface for FSKit. Use this class to discover FSKit extensions installed on the system, including your own.

Discovering installed extensions

See: https://developer.apple.com/documentation/FSKit/FSClient

func FSClientFromID

func FSClientFromID(id objc.ID) FSClient

FSClientFromID constructs a FSClient from an objc.ID.

An interface for apps and daemons to interact with FSKit.

func NewFSClient

func NewFSClient() FSClient

NewFSClient creates a new FSClient instance.

func (FSClient) Autorelease

func (c FSClient) Autorelease() FSClient

Autorelease adds the receiver to the current autorelease pool.

func (FSClient) FetchInstalledExtensions added in v0.6.10

func (c FSClient) FetchInstalledExtensions(ctx context.Context) ([]FSModuleIdentity, error)

FetchInstalledExtensions is a synchronous wrapper around FSClient.FetchInstalledExtensionsWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (FSClient) FetchInstalledExtensionsWithCompletionHandler added in v0.6.10

func (c FSClient) FetchInstalledExtensionsWithCompletionHandler(completionHandler FSModuleIdentityArrayErrorHandler)

Asynchronously retrieves an list of installed file system modules.

completionHandler: A block or closure that executes when FSKit finishes its fetch process. If the fetch succeeds, the first parameter contains an array of FSModuleIdentity instances that identify installed modules. If the fetch fails, the second parameter contains an error detailing the failure.

Discussion

In Swift, you can either call this method and pass a completion handler closure, or get the value of the `installedExtensions` property with the `async` keyword.

See: https://developer.apple.com/documentation/FSKit/FSClient/fetchInstalledExtensions(completionHandler:)

func (FSClient) Init

func (c FSClient) Init() FSClient

Init initializes the instance.

func (FSClient) InstalledExtensions added in v0.6.10

func (c FSClient) InstalledExtensions(handler FSModuleIdentityArrayErrorHandler)

Fetches installed FSKit modules using the FSClient XPC method. [Full Topic]

func (FSClient) InstalledExtensionsSync added in v0.6.10

func (c FSClient) InstalledExtensionsSync(handler FSModuleIdentityArrayErrorHandler)

Fetches installed FSKit modules using the FSClient synchronous XPC method. [Full Topic]

func (FSClient) SetEnabledState added in v0.6.10

func (c FSClient) SetEnabledState(ctx context.Context, identifier string, enabled bool) error

SetEnabledState is a synchronous wrapper around FSClient.SetEnabledStateForIdentifier. It blocks until the completion handler fires or the context is cancelled.

func (FSClient) SetEnabledStateForIdentifier added in v0.6.10

func (c FSClient) SetEnabledStateForIdentifier(identifier string, enabled bool, handler ErrorHandler)

Sets the enabled state for an FSKit module. [Full Topic]

type FSClientClass

type FSClientClass struct {
	// contains filtered or unexported fields
}

func GetFSClientClass

func GetFSClientClass() FSClientClass

GetFSClientClass returns the class object for FSClient.

func (FSClientClass) Alloc

func (fc FSClientClass) Alloc() FSClient

Alloc allocates memory for a new instance of the class.

func (FSClientClass) Class

func (fc FSClientClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

func (FSClientClass) SharedInstance

func (_FSClientClass FSClientClass) SharedInstance() FSClient

The shared instance of the FSKit client class.

See: https://developer.apple.com/documentation/FSKit/FSClient/shared

type FSCompleteIOFlags

type FSCompleteIOFlags uint

See: https://developer.apple.com/documentation/FSKit/FSCompleteIOFlags

const (
	// FSCompleteIOFlagsAsync: A flag that requests that the file system module flush metadata I/O asynchronously.
	FSCompleteIOFlagsAsync FSCompleteIOFlags = 0x400
	// FSCompleteIOFlagsRead: A flag that describes a read operation.
	FSCompleteIOFlagsRead FSCompleteIOFlags = 256
	// FSCompleteIOFlagsWrite: A flag that describes a write operation.
	FSCompleteIOFlagsWrite FSCompleteIOFlags = 512
)

func (FSCompleteIOFlags) String

func (e FSCompleteIOFlags) String() string

type FSContainerIdentifier

type FSContainerIdentifier struct {
	FSEntityIdentifier
}

A type that identifies a container.

Overview

The identifier is either a UUID or a UUID with additional differentiating bytes. Some network protocols evaluate access based on a user ID when connecting. In this situation, when a file server receives multiple client connections with different user IDs, the server provides different file hierarchies to each. For such systems, represent the container identifier as the UUID associated with the server, followed by four or eight bytes to differentiate connections.

Accessing identifier properties

See: https://developer.apple.com/documentation/FSKit/FSContainerIdentifier

func FSContainerIdentifierFromID

func FSContainerIdentifierFromID(id objc.ID) FSContainerIdentifier

FSContainerIdentifierFromID constructs a FSContainerIdentifier from an objc.ID.

A type that identifies a container.

func NewContainerIdentifierWithUUID

func NewContainerIdentifierWithUUID(uuid foundation.NSUUID) FSContainerIdentifier

Creates an entity identifier with the given UUID.

uuid: The UUID to use for this identifier.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:)-9e20k

func NewContainerIdentifierWithUUIDData

func NewContainerIdentifierWithUUIDData(uuid foundation.NSUUID, qualifierData foundation.NSData) FSContainerIdentifier

Creates an entity identifier with the given UUID and qualifier data.

uuid: The UUID to use for this identifier.

qualifierData: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:data:)-8dixs

func NewContainerIdentifierWithUUIDQualifier

func NewContainerIdentifierWithUUIDQualifier(uuid foundation.NSUUID, qualifier uint64) FSContainerIdentifier

Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.

uuid: The UUID to use for this identifier.

qualifier: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:qualifier:)-9ty70

func NewFSContainerIdentifier

func NewFSContainerIdentifier() FSContainerIdentifier

NewFSContainerIdentifier creates a new FSContainerIdentifier instance.

func (FSContainerIdentifier) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSContainerIdentifier) Init

Init initializes the instance.

func (FSContainerIdentifier) VolumeIdentifier

func (c FSContainerIdentifier) VolumeIdentifier() IFSVolumeIdentifier

The volume identifier associated with the container.

Discussion

For unary file systems, the volume identifier is the same as the container identifier.

See: https://developer.apple.com/documentation/FSKit/FSContainerIdentifier/volumeIdentifier

type FSContainerIdentifierClass

type FSContainerIdentifierClass struct {
	// contains filtered or unexported fields
}

func GetFSContainerIdentifierClass

func GetFSContainerIdentifierClass() FSContainerIdentifierClass

GetFSContainerIdentifierClass returns the class object for FSContainerIdentifier.

func (FSContainerIdentifierClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSContainerIdentifierClass) Class

Class returns the underlying Objective-C class pointer.

type FSContainerState

type FSContainerState int

See: https://developer.apple.com/documentation/FSKit/FSContainerState

const (
	// FSContainerStateActive: The container is active, and one or more volumes are active.
	FSContainerStateActive FSContainerState = 3
	// FSContainerStateBlocked: The container is blocked from transitioning from the not-ready state to the ready state by a potentially-recoverable error.
	FSContainerStateBlocked FSContainerState = 1
	// FSContainerStateNotReady: The container isn’t ready.
	FSContainerStateNotReady FSContainerState = 0
	// FSContainerStateReady: The container is ready, but inactive.
	FSContainerStateReady FSContainerState = 2
)

func (FSContainerState) String

func (e FSContainerState) String() string

type FSContainerStatus

type FSContainerStatus struct {
	objectivec.Object
}

A type that represents a container’s status.

Overview

This type contains two properties:

- The FSContainerStatus.State value that indicates the state of the container, such as FSContainerStateReady or FSContainerStateBlocked. - The FSContainerStatus.Status is an error (optional in Swift, nullable in Objective-C) that provides further information about the state, such as why the container is blocked.

Examples of statuses that require intervention include errors that indicate the container isn’t ready (POSIX [EAGAIN] or [ENOTCONN]), the container needs authentication ([ENEEDAUTH]), or that authentication failed ([EAUTH]). The status can also be an informative error, such as the FSKit error FSErrorStatusOperationInProgress.

Inspecting status properties

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus

func FSContainerStatusFromID

func FSContainerStatusFromID(id objc.ID) FSContainerStatus

FSContainerStatusFromID constructs a FSContainerStatus from an objc.ID.

A type that represents a container’s status.

func NewFSContainerStatus

func NewFSContainerStatus() FSContainerStatus

NewFSContainerStatus creates a new FSContainerStatus instance.

func (FSContainerStatus) Autorelease

func (c FSContainerStatus) Autorelease() FSContainerStatus

Autorelease adds the receiver to the current autorelease pool.

func (FSContainerStatus) Init

Init initializes the instance.

func (FSContainerStatus) State

A value that represents the container state, such as ready, active, or blocked.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/state

func (FSContainerStatus) Status

An optional error that provides further information about the state.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/status

type FSContainerStatusClass

type FSContainerStatusClass struct {
	// contains filtered or unexported fields
}

func GetFSContainerStatusClass

func GetFSContainerStatusClass() FSContainerStatusClass

GetFSContainerStatusClass returns the class object for FSContainerStatus.

func (FSContainerStatusClass) Active

func (_FSContainerStatusClass FSContainerStatusClass) Active() FSContainerStatus

A status that represents an active container with no error.

Discussion

This value is a FSContainerStatus with a FSContainerStatus.State that is FSContainerStatusClass.Active, and has a FSContainerStatus.Status that is `nil`.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/active

func (FSContainerStatusClass) ActiveWithStatus

func (_FSContainerStatusClass FSContainerStatusClass) ActiveWithStatus(errorStatus foundation.NSError) FSContainerStatus

Returns a active container status instance with the provided error status.

errorStatus: The error status, if any, for the new instance.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/active(status:)

func (FSContainerStatusClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSContainerStatusClass) BlockedWithStatus

func (_FSContainerStatusClass FSContainerStatusClass) BlockedWithStatus(errorStatus foundation.NSError) FSContainerStatus

Returns a blocked container status instance with the provided error status.

errorStatus: The error status, if any, for the new instance.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/blocked(status:)

func (FSContainerStatusClass) Class

func (fc FSContainerStatusClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

func (FSContainerStatusClass) NotReadyWithStatus

func (_FSContainerStatusClass FSContainerStatusClass) NotReadyWithStatus(errorStatus foundation.NSError) FSContainerStatus

Returns a not-ready container status instance with the provided error status.

errorStatus: The error status, if any, for the new instance.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/notReady(status:)

func (FSContainerStatusClass) Ready

func (_FSContainerStatusClass FSContainerStatusClass) Ready() FSContainerStatus

A status that represents a ready container with no error.

Discussion

This value is a FSContainerStatus with a FSContainerStatus.State that is FSContainerStatusClass.Ready, and a FSContainerStatus.Status that is `nil`.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/ready

func (FSContainerStatusClass) ReadyWithStatus

func (_FSContainerStatusClass FSContainerStatusClass) ReadyWithStatus(errorStatus foundation.NSError) FSContainerStatus

Returns a ready container status instance with the provided error status.

errorStatus: The error status, if any, for the new instance.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus/ready(status:)

type FSDeactivateOptions

type FSDeactivateOptions int

See: https://developer.apple.com/documentation/FSKit/FSDeactivateOptions

const (
	// FSDeactivateOptionsForce: An option to force deactivation.
	FSDeactivateOptionsForce FSDeactivateOptions = 1
)

func (FSDeactivateOptions) String

func (e FSDeactivateOptions) String() string

type FSDirectoryCookie

type FSDirectoryCookie = uint64

FSDirectoryCookie is a value that indicates a location in a directory from which to enumerate.

See: https://developer.apple.com/documentation/FSKit/FSDirectoryCookie

var (
	// FSDirectoryCookieInitial is the constant initial value for the directory-enumeration cookie.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSDirectoryCookie/initial
	FSDirectoryCookieInitial FSDirectoryCookie
)

type FSDirectoryEntryPacker

type FSDirectoryEntryPacker struct {
	objectivec.Object
}

An object used to provide items during a directory enumeration.

Overview

You use this type in your implementation of [EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler].

Packing allows your implementation to provide information FSKit needs, including each item’s name, type, and identifier (such as an inode number). Some directory enumerations require other attributes, as indicated by the FSItemGetAttributesRequest sent to the enumerate method.

Packing entries

See: https://developer.apple.com/documentation/FSKit/FSDirectoryEntryPacker

func FSDirectoryEntryPackerFromID

func FSDirectoryEntryPackerFromID(id objc.ID) FSDirectoryEntryPacker

FSDirectoryEntryPackerFromID constructs a FSDirectoryEntryPacker from an objc.ID.

An object used to provide items during a directory enumeration.

func NewFSDirectoryEntryPacker

func NewFSDirectoryEntryPacker() FSDirectoryEntryPacker

NewFSDirectoryEntryPacker creates a new FSDirectoryEntryPacker instance.

func (FSDirectoryEntryPacker) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSDirectoryEntryPacker) Init

Init initializes the instance.

func (FSDirectoryEntryPacker) PackEntryWithNameItemTypeItemIDNextCookieAttributes

func (d FSDirectoryEntryPacker) PackEntryWithNameItemTypeItemIDNextCookieAttributes(name IFSFileName, itemType FSItemType, itemID FSItemID, nextCookie FSDirectoryCookie, attributes IFSItemAttributes) bool

Provides a directory entry during enumeration.

name: The item’s name.

itemType: The type of the item.

itemID: The item’s identifier. Typically this is an inode number, or one of the constants defined by FSItem.Identifier like FSItemIDRootDirectory.

nextCookie: A value to indicate the next entry in the directory to enumerate. FSKit passes this value as the `cookie` parameter on the next call to [EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler]. Use whatever value is appropriate for your implementation; the value is opaque to FSKit.

attributes: The item’s attributes. Pass `nil` if the enumeration call didn’t request attributes.

Return Value

`true` (Swift) or [YES] (Objective-C) if packing was successful and enumeration can continue with the next directory entry. If the value is `false` (Swift) or [NO] (Objective-C), stop enumerating. This result can happen when the entry is too big for the remaining space in the buffer.

Discussion

You call this method in your implementation of [EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler], for each directory entry you want to provide to the enumeration.

See: https://developer.apple.com/documentation/FSKit/FSDirectoryEntryPacker/packEntry(name:itemType:itemID:nextCookie:attributes:)

type FSDirectoryEntryPackerClass

type FSDirectoryEntryPackerClass struct {
	// contains filtered or unexported fields
}

func GetFSDirectoryEntryPackerClass

func GetFSDirectoryEntryPackerClass() FSDirectoryEntryPackerClass

GetFSDirectoryEntryPackerClass returns the class object for FSDirectoryEntryPacker.

func (FSDirectoryEntryPackerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSDirectoryEntryPackerClass) Class

Class returns the underlying Objective-C class pointer.

type FSDirectoryVerifier

type FSDirectoryVerifier = uint64

FSDirectoryVerifier is a tool to detect whether the directory contents changed since the last call to enumerate a directory.

See: https://developer.apple.com/documentation/FSKit/FSDirectoryVerifier

var (
	// FSDirectoryVerifierInitial is the constant initial value for the directory-enumeration verifier.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSDirectoryVerifier/initial
	FSDirectoryVerifierInitial FSDirectoryVerifier
)

type FSDirectoryVerifierErrorHandler

type FSDirectoryVerifierErrorHandler = func(FSDirectoryVerifier, error)

FSDirectoryVerifierErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeOperations.EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler]

type FSEntityIdentifier

type FSEntityIdentifier struct {
	objectivec.Object
}

A base type that identifies containers and volumes.

Overview

An FSEntityIdentifier is a UUID to identify a container or volume, optionally with eight bytes of qualifying (differentiating) data. You use the qualifiers in cases in which a file server can receive multiple connections from the same client, which differ by user credentials. In this case, the identifier for each client is the server’s base UUID, and a unique qualifier that differs by client.

Creating an entity identifier

Inspecting identifier properties

Initializers

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier

func FSEntityIdentifierFromID

func FSEntityIdentifierFromID(id objc.ID) FSEntityIdentifier

FSEntityIdentifierFromID constructs a FSEntityIdentifier from an objc.ID.

A base type that identifies containers and volumes.

func NewEntityIdentifierWithUUID

func NewEntityIdentifierWithUUID(uuid foundation.NSUUID) FSEntityIdentifier

Creates an entity identifier with the given UUID.

uuid: The UUID to use for this identifier.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:)-9e20k

func NewEntityIdentifierWithUUIDData

func NewEntityIdentifierWithUUIDData(uuid foundation.NSUUID, qualifierData foundation.NSData) FSEntityIdentifier

Creates an entity identifier with the given UUID and qualifier data.

uuid: The UUID to use for this identifier.

qualifierData: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:data:)-8dixs

func NewEntityIdentifierWithUUIDQualifier

func NewEntityIdentifierWithUUIDQualifier(uuid foundation.NSUUID, qualifier uint64) FSEntityIdentifier

Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.

uuid: The UUID to use for this identifier.

qualifier: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:qualifier:)-9ty70

func NewFSEntityIdentifier

func NewFSEntityIdentifier() FSEntityIdentifier

NewFSEntityIdentifier creates a new FSEntityIdentifier instance.

func (FSEntityIdentifier) Autorelease

func (e FSEntityIdentifier) Autorelease() FSEntityIdentifier

Autorelease adds the receiver to the current autorelease pool.

func (FSEntityIdentifier) EncodeWithCoder

func (e FSEntityIdentifier) EncodeWithCoder(coder foundation.INSCoder)

func (FSEntityIdentifier) Init

Init initializes the instance.

func (FSEntityIdentifier) InitWithUUID

Creates an entity identifier with the given UUID.

uuid: The UUID to use for this identifier.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:)-9e20k

func (FSEntityIdentifier) InitWithUUIDData

func (e FSEntityIdentifier) InitWithUUIDData(uuid foundation.NSUUID, qualifierData foundation.NSData) FSEntityIdentifier

Creates an entity identifier with the given UUID and qualifier data.

uuid: The UUID to use for this identifier.

qualifierData: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:data:)-8dixs

func (FSEntityIdentifier) InitWithUUIDQualifier

func (e FSEntityIdentifier) InitWithUUIDQualifier(uuid foundation.NSUUID, qualifier uint64) FSEntityIdentifier

Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.

uuid: The UUID to use for this identifier.

qualifier: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:qualifier:)-9ty70

func (FSEntityIdentifier) Qualifier

func (e FSEntityIdentifier) Qualifier() foundation.NSData

An optional piece of data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/qualifier

func (FSEntityIdentifier) SetQualifier

func (e FSEntityIdentifier) SetQualifier(value foundation.NSData)

func (FSEntityIdentifier) SetUuid

func (e FSEntityIdentifier) SetUuid(value foundation.NSUUID)

func (FSEntityIdentifier) Uuid

A UUID to uniquely identify this entity.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/uuid

type FSEntityIdentifierClass

type FSEntityIdentifierClass struct {
	// contains filtered or unexported fields
}

func GetFSEntityIdentifierClass

func GetFSEntityIdentifierClass() FSEntityIdentifierClass

GetFSEntityIdentifierClass returns the class object for FSEntityIdentifier.

func (FSEntityIdentifierClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSEntityIdentifierClass) Class

func (fc FSEntityIdentifierClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSErrorCode

type FSErrorCode int

See: https://developer.apple.com/documentation/FSKit/FSError/Code

const (
	// FSErrorInvalidDirectoryCookie: While enumerating a directory, the given cookie didn’t resolve to a valid directory entry.
	FSErrorInvalidDirectoryCookie FSErrorCode = 4506
	// FSErrorModuleLoadFailed: The module failed to load.
	FSErrorModuleLoadFailed FSErrorCode = 4500
	// FSErrorResourceDamaged: The resource is damaged.
	FSErrorResourceDamaged FSErrorCode = 4502
	// FSErrorResourceUnrecognized: FSKit didn’t recognize the resource, and probing failed to find a match.
	FSErrorResourceUnrecognized FSErrorCode = 4501
	// FSErrorResourceUnusable: FSKit recognizes the resource, but the resource isn’t usable.
	FSErrorResourceUnusable FSErrorCode = 4503
	// FSErrorStatusOperationInProgress: An operation is in progress.
	FSErrorStatusOperationInProgress FSErrorCode = 4504
	// FSErrorStatusOperationPaused: An operation is paused.
	FSErrorStatusOperationPaused FSErrorCode = 4505
)

func (FSErrorCode) String

func (e FSErrorCode) String() string

type FSExtentPacker

type FSExtentPacker struct {
	objectivec.Object
}

A type that directs the kernel to map space on disk to a specific file managed by this file system.

Overview

provide the kernel the logical-to-physical mapping of a given file. An extent describes a physical offset on disk, and a length and a logical offset within the file. Rather than working with extents directly, you use this type’s methods to provide or “pack” extent information, which FSKit then passes to the kernel.

Packing extents

See: https://developer.apple.com/documentation/FSKit/FSExtentPacker

func FSExtentPackerFromID

func FSExtentPackerFromID(id objc.ID) FSExtentPacker

FSExtentPackerFromID constructs a FSExtentPacker from an objc.ID.

A type that directs the kernel to map space on disk to a specific file managed by this file system.

func NewFSExtentPacker

func NewFSExtentPacker() FSExtentPacker

NewFSExtentPacker creates a new FSExtentPacker instance.

func (FSExtentPacker) Autorelease

func (e FSExtentPacker) Autorelease() FSExtentPacker

Autorelease adds the receiver to the current autorelease pool.

func (FSExtentPacker) Init

func (e FSExtentPacker) Init() FSExtentPacker

Init initializes the instance.

func (FSExtentPacker) PackExtentWithResourceTypeLogicalOffsetPhysicalOffsetLength

func (e FSExtentPacker) PackExtentWithResourceTypeLogicalOffsetPhysicalOffsetLength(resource IFSBlockDeviceResource, type_ FSExtentType, logicalOffset int64, physicalOffset int64, length uintptr) bool

Packs a single extent to send to the kernel.

resource: The resource on which to perform I/O.

type: The type of extent, indicating whether it contains valid data.

logicalOffset: The extent offset within the file, in bytes.

physicalOffset: The extent offset on disk, in bytes.

length: The extent length, in bytes.

Return Value

A Boolean value that indicates whether the packer can pack more extents.

See: https://developer.apple.com/documentation/FSKit/FSExtentPacker/packExtent(resource:type:logicalOffset:physicalOffset:length:)

type FSExtentPackerClass

type FSExtentPackerClass struct {
	// contains filtered or unexported fields
}

func GetFSExtentPackerClass

func GetFSExtentPackerClass() FSExtentPackerClass

GetFSExtentPackerClass returns the class object for FSExtentPacker.

func (FSExtentPackerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSExtentPackerClass) Class

func (fc FSExtentPackerClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSExtentType

type FSExtentType int

See: https://developer.apple.com/documentation/FSKit/FSExtentType

const (
	// FSExtentTypeData: An extent type to indicate valid data.
	FSExtentTypeData FSExtentType = 0
	// FSExtentTypeZeroFill: An extent type to indicate uninitialized data.
	FSExtentTypeZeroFill FSExtentType = 1
)

func (FSExtentType) String

func (e FSExtentType) String() string

type FSFileName

type FSFileName struct {
	objectivec.Object
}

The name of a file, expressed as a data buffer.

Overview

FSFileName is the class that carries filenames from the kernel to [FSModule] instances, and carries names back to the kernel as part of directory enumeration.

A filename is usually a valid UTF-8 sequence, but can be an arbitrary byte sequence that doesn’t conform to that format. As a result, the FSFileName.Data property always contains a value, but the FSFileName.String property may be empty. An [FSModule] can receive an FSFileName that isn’t valid UTF-8 in two cases:

- A program passes erroneous data to a system call. The [FSModule] treats this situation as an error. - An [FSModule] lacks the character encoding used for a file name. This situation occurs because some file system formats consider a filename to be an arbitrary “bag of bytes,” and leave character encoding up to the operating system. Without encoding information, the [FSModule] can only pass back the names it finds on disk. In this case, the behavior of upper layers such as FileManager is unspecified. However, the [FSModule] must support looking up such names and using them as the source name of rename operations. The [FSModule] must also be able to support filenames that are derivatives of filenames returned from directory enumeration. Derivative filenames include Apple Double filenames (`"._Name"`), and editor backup filenames.

Creating a filename

Accessing filename properties

Initializers

See: https://developer.apple.com/documentation/FSKit/FSFileName

func FSFileNameFromID

func FSFileNameFromID(id objc.ID) FSFileName

FSFileNameFromID constructs a FSFileName from an objc.ID.

The name of a file, expressed as a data buffer.

func NewFSFileName

func NewFSFileName() FSFileName

NewFSFileName creates a new FSFileName instance.

func NewFileNameWithBytesLength

func NewFileNameWithBytesLength(bytes string, length uint) FSFileName

Initializes a file name by copying a character sequence from a byte array.

Discussion

- bytes: A pointer to the character data to copy, up to a maximum of `length`. The sequence terminates if a [NUL] character exists prior to `length`. - length: The size of the `bytes` array.

See: https://developer.apple.com/documentation/FSKit/FSFileName/initWithBytes:length:

func NewFileNameWithCString

func NewFileNameWithCString(name string) FSFileName

Initializes a filename from a null-terminated character sequence.

name: A pointer to a C string.

Discussion

See: https://developer.apple.com/documentation/FSKit/FSFileName/initWithCString:

func NewFileNameWithData

func NewFileNameWithData(name foundation.NSData) FSFileName

Creates a filename by copying a character sequence data object.

name: The data object containing the character sequence to use for the filename. The sequence terminates if a [NUL] character exists prior to `name.Length()`.

Discussion

This initializer copies up to `name.Length()` characters of the sequence pointed to by `bytes`.

See: https://developer.apple.com/documentation/FSKit/FSFileName/init(data:)

func NewFileNameWithString

func NewFileNameWithString(name string) FSFileName

Creates a filename by copying a character sequence from a string instance.

name: The string containing the character sequence to use for the filename.

Discussion

This initializer copies the UTF-8 representation of the characters in `string`. If `string` contains a [NUL] character, the sequence terminates.

See: https://developer.apple.com/documentation/FSKit/FSFileName/init(string:)

func (FSFileName) Autorelease

func (f FSFileName) Autorelease() FSFileName

Autorelease adds the receiver to the current autorelease pool.

func (FSFileName) Data

func (f FSFileName) Data() foundation.NSData

The byte sequence of the filename, as a data object.

Discussion

This property always provides a value.

See: https://developer.apple.com/documentation/FSKit/FSFileName/data

func (FSFileName) DebugDescription

func (f FSFileName) DebugDescription() string

The filename, represented as a potentially lossy conversion to a string.

Discussion

The exact details of the string conversion may change in the future.

See: https://developer.apple.com/documentation/FSKit/FSFileName/debugDescription

func (FSFileName) EncodeWithCoder

func (f FSFileName) EncodeWithCoder(coder foundation.INSCoder)

func (FSFileName) Init

func (f FSFileName) Init() FSFileName

Init initializes the instance.

func (FSFileName) InitWithBytesLength

func (f FSFileName) InitWithBytesLength(bytes string, length uint) FSFileName

Initializes a file name by copying a character sequence from a byte array.

Discussion

- bytes: A pointer to the character data to copy, up to a maximum of `length`. The sequence terminates if a [NUL] character exists prior to `length`. - length: The size of the `bytes` array.

See: https://developer.apple.com/documentation/FSKit/FSFileName/initWithBytes:length:

func (FSFileName) InitWithCString

func (f FSFileName) InitWithCString(name string) FSFileName

Initializes a filename from a null-terminated character sequence.

name: A pointer to a C string.

Discussion

See: https://developer.apple.com/documentation/FSKit/FSFileName/initWithCString:

func (FSFileName) InitWithData

func (f FSFileName) InitWithData(name foundation.NSData) FSFileName

Creates a filename by copying a character sequence data object.

name: The data object containing the character sequence to use for the filename. The sequence terminates if a [NUL] character exists prior to `name.Length()`.

Discussion

This initializer copies up to `name.Length()` characters of the sequence pointed to by `bytes`.

See: https://developer.apple.com/documentation/FSKit/FSFileName/init(data:)

func (FSFileName) InitWithString

func (f FSFileName) InitWithString(name string) FSFileName

Creates a filename by copying a character sequence from a string instance.

name: The string containing the character sequence to use for the filename.

Discussion

This initializer copies the UTF-8 representation of the characters in `string`. If `string` contains a [NUL] character, the sequence terminates.

See: https://developer.apple.com/documentation/FSKit/FSFileName/init(string:)

func (FSFileName) String

func (f FSFileName) String() string

The filename, represented as a Unicode string.

Discussion

If the value of the filename’s FSFileName.Data is not a valid UTF-8 byte sequence, this property is empty.

See: https://developer.apple.com/documentation/FSKit/FSFileName/string

type FSFileNameArrayErrorHandler

type FSFileNameArrayErrorHandler = func(*[]FSFileName, error)

FSFileNameArrayErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeXattrOperations.ListXattrsOfItemReplyHandler]

type FSFileNameClass

type FSFileNameClass struct {
	// contains filtered or unexported fields
}

func GetFSFileNameClass

func GetFSFileNameClass() FSFileNameClass

GetFSFileNameClass returns the class object for FSFileName.

func (FSFileNameClass) Alloc

func (fc FSFileNameClass) Alloc() FSFileName

Alloc allocates memory for a new instance of the class.

func (FSFileNameClass) Class

func (fc FSFileNameClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

func (FSFileNameClass) NameWithBytesLength

func (_FSFileNameClass FSFileNameClass) NameWithBytesLength(bytes string, length uint) FSFileName

Creates a filename by copying a character sequence from a byte array.

Discussion

- bytes: A pointer to the character data to copy, up to a maximum of `length`. The sequence terminates if a [NUL] character exists prior to `length`. - length: The size of the `bytes` array.

See: https://developer.apple.com/documentation/FSKit/FSFileName/nameWithBytes:length:

func (FSFileNameClass) NameWithCString

func (_FSFileNameClass FSFileNameClass) NameWithCString(name string) FSFileName

Creates a filename from a null-terminated character sequence.

name: A pointer to a C string.

See: https://developer.apple.com/documentation/FSKit/FSFileName/nameWithCString:

func (FSFileNameClass) NameWithData

func (_FSFileNameClass FSFileNameClass) NameWithData(name foundation.NSData) FSFileName

Creates a filename by copying a character sequence data object.

name: The data object containing the character sequence to use for the filename. The sequence terminates if a [NUL] character exists prior to `name.Length()`.

Discussion

This initializer copies up to `name.Length()` characters of the sequence pointed to by `bytes`.

See: https://developer.apple.com/documentation/FSKit/FSFileName/nameWithData:

func (FSFileNameClass) NameWithString

func (_FSFileNameClass FSFileNameClass) NameWithString(name string) FSFileName

Creates a filename by copying a character sequence from a string instance.

name: The string containing the character sequence to use for the filename.

Discussion

This initializer copies the UTF-8 representation of the characters in `string`. If `string` contains a [NUL] character, the sequence terminates.

See: https://developer.apple.com/documentation/FSKit/FSFileName/nameWithString:

type FSFileNameErrorHandler

type FSFileNameErrorHandler = func(*FSFileName, error)

FSFileNameErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeOperations.CreateLinkToItemNamedInDirectoryReplyHandler]
  • [FSVolumeOperations.ReadSymbolicLinkReplyHandler]
  • [FSVolumeOperations.RenameItemInDirectoryNamedToNewNameInDirectoryOverItemReplyHandler]
  • [FSVolumeRenameOperations.SetVolumeNameReplyHandler]

type FSFileSystem

type FSFileSystem struct {
	objectivec.Object
}

An abstract base class for implementing a full-featured file system.

Overview

FSFileSystem is a full-featured file system, which works with one or more FSResource instances and presents one or more FSVolume references to callers.

Implement your app extension by providing a subclass of FSFileSystem as a delegate object. Your delegate also needs to implement the [FSFileSystemOperations] protocol so that it can probe, load, and unload resources.

See: https://developer.apple.com/documentation/FSKit/FSFileSystem

func FSFileSystemFromID

func FSFileSystemFromID(id objc.ID) FSFileSystem

FSFileSystemFromID constructs a FSFileSystem from an objc.ID.

An abstract base class for implementing a full-featured file system.

func NewFSFileSystem

func NewFSFileSystem() FSFileSystem

NewFSFileSystem creates a new FSFileSystem instance.

func (FSFileSystem) Autorelease

func (f FSFileSystem) Autorelease() FSFileSystem

Autorelease adds the receiver to the current autorelease pool.

func (FSFileSystem) ContainerStatus

func (f FSFileSystem) ContainerStatus() IFSContainerStatus

The status of the file system container, indicating its readiness and activity.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus

func (FSFileSystem) Init

func (f FSFileSystem) Init() FSFileSystem

Init initializes the instance.

func (FSFileSystem) SetContainerStatus

func (o FSFileSystem) SetContainerStatus(value IFSContainerStatus)

The status of the file system container, indicating its readiness and activity.

Discussion

A file system container starts in the FSContainerStateNotReady state, and then transitions to the other values of the FSContainerState enumeration. The following diagram illustrates the possible state transitions.

[fs-file-system-base]

Your file system implementation updates this property as it changes state. Many events and operations may trigger a state transition, and some transitions depend on a specific file system’s design.

When using FSBlockDeviceResource, implement the following common state transitions:

- Calling `loadResource` transitions the state out of FSContainerStateNotReady. For all block device file systems, this operation changes the state to either FSContainerStateReady or FSContainerStateBlocked. - Calling `unloadResource` transitions to the FSContainerStateNotReady state, as does device termination. - Transitioning from FSContainerStateBlocked to FSContainerStateReady occurs as a result of resolving the underlying block favorably. - Transitioning from FSContainerStateReady to FSContainerStateBlocked is unusal, but valid. - Transitioning between FSContainerStateReady and FSContainerStateActive can result from maintenance operations such as [StartCheckWithTaskOptionsError]. For a FSUnaryFileSystem, this transition can also occur when activating or deactivating the container’s single volume.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus

func (FSFileSystem) WipeResource

func (f FSFileSystem) WipeResource(ctx context.Context, resource IFSBlockDeviceResource) error

WipeResource is a synchronous wrapper around FSFileSystem.WipeResourceCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (FSFileSystem) WipeResourceCompletionHandler

func (f FSFileSystem) WipeResourceCompletionHandler(resource IFSBlockDeviceResource, completion ErrorHandler)

Wipes existing file systems on the specified resource.

resource: The FSBlockDeviceResource to wipe.

completion: A block or closure that executes after the wipe operation completes. The completion handler receives a single parameter indicating any error that occurs during the operation. If the value is `nil`, the wipe operation succeeded.

Discussion

This method wraps the `wipefs` functionality from `libutil`. For more information, see the `man` page for `wipefs`.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/wipe(_:completionHandler:)

type FSFileSystemBase

type FSFileSystemBase interface {
	objectivec.IObject

	// Wipes existing file systems on the specified resource.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/wipe(_:completionHandler:)
	WipeResourceCompletionHandler(resource IFSBlockDeviceResource, completion ErrorHandler)

	// The status of the file system container, indicating its readiness and activity.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus
	ContainerStatus() IFSContainerStatus
	SetContainerStatus(value IFSContainerStatus)
}

A protocol containing functionality supplied by FSKit to file system implementations.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase

type FSFileSystemBaseObject

type FSFileSystemBaseObject struct {
	objectivec.Object
}

FSFileSystemBaseObject wraps an existing Objective-C object that conforms to the FSFileSystemBase protocol.

func FSFileSystemBaseObjectFromID

func FSFileSystemBaseObjectFromID(id objc.ID) FSFileSystemBaseObject

FSFileSystemBaseObjectFromID constructs a FSFileSystemBaseObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSFileSystemBaseObject) BaseObject

func (o FSFileSystemBaseObject) BaseObject() objectivec.Object

func (FSFileSystemBaseObject) ContainerStatus

func (o FSFileSystemBaseObject) ContainerStatus() IFSContainerStatus

The status of the file system container, indicating its readiness and activity.

Discussion

A file system container starts in the FSContainerStateNotReady state, and then transitions to the other values of the FSContainerState enumeration. The following diagram illustrates the possible state transitions.

[fs-file-system-base]

Your file system implementation updates this property as it changes state. Many events and operations may trigger a state transition, and some transitions depend on a specific file system’s design.

When using FSBlockDeviceResource, implement the following common state transitions:

- Calling `loadResource` transitions the state out of FSContainerStateNotReady. For all block device file systems, this operation changes the state to either FSContainerStateReady or FSContainerStateBlocked. - Calling `unloadResource` transitions to the FSContainerStateNotReady state, as does device termination. - Transitioning from FSContainerStateBlocked to FSContainerStateReady occurs as a result of resolving the underlying block favorably. - Transitioning from FSContainerStateReady to FSContainerStateBlocked is unusal, but valid. - Transitioning between FSContainerStateReady and FSContainerStateActive can result from maintenance operations such as [StartCheckWithTaskOptionsError]. For a FSUnaryFileSystem, this transition can also occur when activating or deactivating the container’s single volume.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus

func (FSFileSystemBaseObject) SetContainerStatus

func (o FSFileSystemBaseObject) SetContainerStatus(value IFSContainerStatus)

func (FSFileSystemBaseObject) WipeResourceCompletionHandler

func (o FSFileSystemBaseObject) WipeResourceCompletionHandler(resource IFSBlockDeviceResource, completion ErrorHandler)

Wipes existing file systems on the specified resource.

resource: The FSBlockDeviceResource to wipe.

completion: A block or closure that executes after the wipe operation completes. The completion handler receives a single parameter indicating any error that occurs during the operation. If the value is `nil`, the wipe operation succeeded.

Discussion

This method wraps the `wipefs` functionality from `libutil`. For more information, see the `man` page for `wipefs`.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/wipe(_:completionHandler:)

type FSFileSystemClass

type FSFileSystemClass struct {
	// contains filtered or unexported fields
}

func GetFSFileSystemClass

func GetFSFileSystemClass() FSFileSystemClass

GetFSFileSystemClass returns the class object for FSFileSystem.

func (FSFileSystemClass) Alloc

func (fc FSFileSystemClass) Alloc() FSFileSystem

Alloc allocates memory for a new instance of the class.

func (FSFileSystemClass) Class

func (fc FSFileSystemClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSGenericURLResource

type FSGenericURLResource struct {
	FSResource
}

A resource that represents an abstract URL.

Overview

An FSGenericURLResource is a completely abstract resource. The only reference to its contents is a single URL, the contents of which are arbitrary. This URL might represent a PCI locator string like `/pci@f0000000/usb@5`, or some sort of network address for a remote file system. FSKit leaves interpretation of the URL and its contents entirely up to your implementation.

Use the `Info.Plist()` key [FSSupportedSchemes] to provide an array of case-insensitive URL schemes that your implementation supports. The following example shows how a hypothetical FSGenericURLResource implementation declares support for the `rsh` and `ssh` URL schemes:

Creating a generic URL resource

Accessing resource properties

See: https://developer.apple.com/documentation/FSKit/FSGenericURLResource

func FSGenericURLResourceFromID

func FSGenericURLResourceFromID(id objc.ID) FSGenericURLResource

FSGenericURLResourceFromID constructs a FSGenericURLResource from an objc.ID.

A resource that represents an abstract URL.

func NewFSGenericURLResource

func NewFSGenericURLResource() FSGenericURLResource

NewFSGenericURLResource creates a new FSGenericURLResource instance.

func NewGenericURLResourceWithURL

func NewGenericURLResourceWithURL(url foundation.NSURL) FSGenericURLResource

Creates a generic URL resource with the given URL.

url: A URL that provides the content of the file system. The format of this URL is completely arbitrary. It’s up to your extension to access the contents represented by the URL and make them available as an FSVolume that FSKit can load.

See: https://developer.apple.com/documentation/FSKit/FSGenericURLResource/init(url:)-2cmhi

func (FSGenericURLResource) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSGenericURLResource) Init

Init initializes the instance.

func (FSGenericURLResource) InitWithURL

Creates a generic URL resource with the given URL.

url: A URL that provides the content of the file system. The format of this URL is completely arbitrary. It’s up to your extension to access the contents represented by the URL and make them available as an FSVolume that FSKit can load.

See: https://developer.apple.com/documentation/FSKit/FSGenericURLResource/init(url:)-2cmhi

func (FSGenericURLResource) Url

The URL represented by the resource.

See: https://developer.apple.com/documentation/FSKit/FSGenericURLResource/url

type FSGenericURLResourceClass

type FSGenericURLResourceClass struct {
	// contains filtered or unexported fields
}

func GetFSGenericURLResourceClass

func GetFSGenericURLResourceClass() FSGenericURLResourceClass

GetFSGenericURLResourceClass returns the class object for FSGenericURLResource.

func (FSGenericURLResourceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSGenericURLResourceClass) Class

Class returns the underlying Objective-C class pointer.

type FSItem

type FSItem struct {
	objectivec.Object
}

A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.

Overview

An FSItem is a mostly opaque object, which your file system implementation defines as needed.

The FSItemAttributes class defines nonatomic properties to support FSItem instances. An FSItemAttributes instance contains a snapshot of the attributes of an FSItem at one point in time. The FSItemAttributes properties have no explicit thread safety provisions, since the operations that either get or set these properties enforce thread safety.

You test an attribute’s validity with the the method FSItemAttributes.IsValid. If the value is `true` (Swift) or [YES] (Objective-C), it’s safe to use the attribute.

Methods that get or set an item’s attribute use FSItemGetAttributesRequest or FSItemSetAttributesRequest, respectively. Both are subclasses of FSItemAttributes. An FSItemGetAttributesRequest contains a FSItemGetAttributesRequest.WantedAttributes property to indicate the attributes a file system provides for the request. Similarly, FSItemSetAttributesRequest uses the property FSItemSetAttributesRequest.ConsumedAttributes for a file system to signal back which attributes it successfully used.

FSItem is the FSKit equivelant of a vnode in the kernel. For every FSKit vnode in the kernel, the [FSModule] hosting the volume has an instantiated FSItem.

See: https://developer.apple.com/documentation/FSKit/FSItem

func FSItemFromID

func FSItemFromID(id objc.ID) FSItem

FSItemFromID constructs a FSItem from an objc.ID.

A distinct object in a file hierarchy, such as a file, directory, symlink, socket, and more.

func NewFSItem

func NewFSItem() FSItem

NewFSItem creates a new FSItem instance.

func (FSItem) Autorelease

func (i FSItem) Autorelease() FSItem

Autorelease adds the receiver to the current autorelease pool.

func (FSItem) ConsumedAttributes

func (i FSItem) ConsumedAttributes() unsafe.Pointer

The attributes successfully used by the file system.

See: https://developer.apple.com/documentation/fskit/fsitem/setattributesrequest/consumedattributes

func (FSItem) Init

func (i FSItem) Init() FSItem

Init initializes the instance.

func (FSItem) SetConsumedAttributes

func (i FSItem) SetConsumedAttributes(value kernel.Pointer)

func (FSItem) SetWantedAttributes

func (i FSItem) SetWantedAttributes(value kernel.Pointer)

func (FSItem) WantedAttributes

func (i FSItem) WantedAttributes() unsafe.Pointer

The attributes requested by the request.

See: https://developer.apple.com/documentation/fskit/fsitem/getattributesrequest/wantedattributes

type FSItemAttribute

type FSItemAttribute int

See: https://developer.apple.com/documentation/FSKit/FSItem/Attribute

const (
	// FSItemAttributeAccessTime: The last-accessed time attribute.
	FSItemAttributeAccessTime FSItemAttribute = 1024
	// FSItemAttributeAddedTime: The time added attribute.
	FSItemAttributeAddedTime FSItemAttribute = 32768
	// FSItemAttributeAllocSize: The allocated size attribute.
	FSItemAttributeAllocSize FSItemAttribute = 128
	// FSItemAttributeBackupTime: The backup time attribute.
	FSItemAttributeBackupTime FSItemAttribute = 16384
	// FSItemAttributeBirthTime: The creation time attribute.
	FSItemAttributeBirthTime FSItemAttribute = 8192
	// FSItemAttributeChangeTime: The last-changed time attribute.
	FSItemAttributeChangeTime FSItemAttribute = 4096
	// FSItemAttributeFileID: The file ID attribute.
	FSItemAttributeFileID FSItemAttribute = 256
	// FSItemAttributeFlags: The flags attribute.
	FSItemAttributeFlags FSItemAttribute = 32
	// FSItemAttributeGID: The group ID (gid) attribute.
	FSItemAttributeGID FSItemAttribute = 16
	// FSItemAttributeInhibitKernelOffloadedIO: The inhibit kernel offloaded I/O attribute.
	FSItemAttributeInhibitKernelOffloadedIO FSItemAttribute = 131072
	// FSItemAttributeLinkCount: The link count attribute.
	FSItemAttributeLinkCount FSItemAttribute = 4
	// FSItemAttributeMode: The mode attribute.
	FSItemAttributeMode FSItemAttribute = 2
	// FSItemAttributeModifyTime: The last-modified time attribute.
	FSItemAttributeModifyTime FSItemAttribute = 2048
	// FSItemAttributeParentID: The parent ID attribute.
	FSItemAttributeParentID FSItemAttribute = 512
	// FSItemAttributeSize: The size attribute.
	FSItemAttributeSize FSItemAttribute = 64
	// FSItemAttributeSupportsLimitedXAttrs: The supports limited extended attributes attribute.
	FSItemAttributeSupportsLimitedXAttrs FSItemAttribute = 65536
	// FSItemAttributeType: The type attribute.
	FSItemAttributeType FSItemAttribute = 1
	// FSItemAttributeUID: The user ID (uid) attribute.
	FSItemAttributeUID FSItemAttribute = 8
)

func (FSItemAttribute) String

func (e FSItemAttribute) String() string

type FSItemAttributes

type FSItemAttributes struct {
	objectivec.Object
}

Attributes of an item, such as size, creation and modification times, and user and group identifiers.

Validating and invalidating attributes

Working with identifier attributes

Working with metadata attributes

Working with time attributes

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes

func FSItemAttributesFromID

func FSItemAttributesFromID(id objc.ID) FSItemAttributes

FSItemAttributesFromID constructs a FSItemAttributes from an objc.ID.

Attributes of an item, such as size, creation and modification times, and user and group identifiers.

func NewFSItemAttributes

func NewFSItemAttributes() FSItemAttributes

NewFSItemAttributes creates a new FSItemAttributes instance.

func (FSItemAttributes) AccessTime

func (i FSItemAttributes) AccessTime() syscall.Timespec

The item’s last-accessed time.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/accessTime

func (FSItemAttributes) AddedTime

func (i FSItemAttributes) AddedTime() syscall.Timespec

The item’s added time.

Discussion

This property represents the time the file system added the item to its parent directory.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/addedTime

func (FSItemAttributes) AllocSize

func (i FSItemAttributes) AllocSize() uint64

The item’s allocated size.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/allocSize

func (FSItemAttributes) Autorelease

func (i FSItemAttributes) Autorelease() FSItemAttributes

Autorelease adds the receiver to the current autorelease pool.

func (FSItemAttributes) BackupTime

func (i FSItemAttributes) BackupTime() syscall.Timespec

The item’s last-backup time.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/backupTime

func (FSItemAttributes) BirthTime

func (i FSItemAttributes) BirthTime() syscall.Timespec

The item’s creation time.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/birthTime

func (FSItemAttributes) ChangeTime

func (i FSItemAttributes) ChangeTime() syscall.Timespec

The item’s last-changed time.

Discussion

This property represents `ctime`, the last time the item’s metadata changed.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/changeTime

func (FSItemAttributes) EncodeWithCoder

func (i FSItemAttributes) EncodeWithCoder(coder foundation.INSCoder)

func (FSItemAttributes) FileID

func (i FSItemAttributes) FileID() FSItemID

The item’s file identifier.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/fileID

func (FSItemAttributes) Flags

func (i FSItemAttributes) Flags() uint32

The item’s behavior flags.

Discussion

See `st_flags` in `stat.H()` for flag definitions.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/flags

func (FSItemAttributes) Gid

func (i FSItemAttributes) Gid() uint32

The group identifier.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/gid

func (FSItemAttributes) InhibitKernelOffloadedIO

func (i FSItemAttributes) InhibitKernelOffloadedIO() bool

A Boolean value that indicates whether the file system overrides the per-volume settings for kernel offloaded I/O for a specific file.

Discussion

This property has no meaning if the volume doesn’t conform to FSVolumeKernelOffloadedIOOperations.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/inhibitKernelOffloadedIO

func (FSItemAttributes) Init

Init initializes the instance.

func (FSItemAttributes) InvalidateAllProperties

func (i FSItemAttributes) InvalidateAllProperties()

Marks all attributes inactive.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/invalidateAllProperties()

func (FSItemAttributes) IsValid

func (i FSItemAttributes) IsValid(attribute FSItemAttribute) bool

Returns a Boolean value that indicates whether the attribute is valid.

Discussion

If the value returned by this method is [YES] (Objective-C) or `true` (Swift), a caller can safely use the given attribute.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/isValid(_:)

func (FSItemAttributes) LinkCount

func (i FSItemAttributes) LinkCount() uint32

The number of hard links to the item.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/linkCount

func (FSItemAttributes) Mode

func (i FSItemAttributes) Mode() uint32

The mode of the item.

Discussion

The mode is often used for `setuid`, `setgid`, and `sticky` bits.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/mode

func (FSItemAttributes) ModifyTime

func (i FSItemAttributes) ModifyTime() syscall.Timespec

The item’s last-modified time.

Discussion

This property represents `mtime`, the last time the item’s contents changed.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/modifyTime

func (FSItemAttributes) ParentID

func (i FSItemAttributes) ParentID() FSItemID

The identifier of the item’s parent.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/parentID

func (FSItemAttributes) SetAccessTime

func (i FSItemAttributes) SetAccessTime(value syscall.Timespec)

func (FSItemAttributes) SetAddedTime

func (i FSItemAttributes) SetAddedTime(value syscall.Timespec)

func (FSItemAttributes) SetAllocSize

func (i FSItemAttributes) SetAllocSize(value uint64)

func (FSItemAttributes) SetBackupTime

func (i FSItemAttributes) SetBackupTime(value syscall.Timespec)

func (FSItemAttributes) SetBirthTime

func (i FSItemAttributes) SetBirthTime(value syscall.Timespec)

func (FSItemAttributes) SetChangeTime

func (i FSItemAttributes) SetChangeTime(value syscall.Timespec)

func (FSItemAttributes) SetFileID

func (i FSItemAttributes) SetFileID(value FSItemID)

func (FSItemAttributes) SetFlags

func (i FSItemAttributes) SetFlags(value uint32)

func (FSItemAttributes) SetGid

func (i FSItemAttributes) SetGid(value uint32)

func (FSItemAttributes) SetInhibitKernelOffloadedIO

func (i FSItemAttributes) SetInhibitKernelOffloadedIO(value bool)

func (FSItemAttributes) SetLinkCount

func (i FSItemAttributes) SetLinkCount(value uint32)

func (FSItemAttributes) SetMode

func (i FSItemAttributes) SetMode(value uint32)

func (FSItemAttributes) SetModifyTime

func (i FSItemAttributes) SetModifyTime(value syscall.Timespec)

func (FSItemAttributes) SetParentID

func (i FSItemAttributes) SetParentID(value FSItemID)

func (FSItemAttributes) SetSize

func (i FSItemAttributes) SetSize(value uint64)

func (FSItemAttributes) SetSupportsLimitedXAttrs

func (i FSItemAttributes) SetSupportsLimitedXAttrs(value bool)

func (FSItemAttributes) SetType

func (i FSItemAttributes) SetType(value FSItemType)

func (FSItemAttributes) SetUid

func (i FSItemAttributes) SetUid(value uint32)

func (FSItemAttributes) Size

func (i FSItemAttributes) Size() uint64

The item’s size.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/size

func (FSItemAttributes) SupportsLimitedXAttrs

func (i FSItemAttributes) SupportsLimitedXAttrs() bool

A Boolean value that indicates whether the item supports a limited set of extended attributes.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/supportsLimitedXAttrs

func (FSItemAttributes) Type

func (i FSItemAttributes) Type() FSItemType

The item type, such as a regular file, directory, or symbolic link.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/type

func (FSItemAttributes) Uid

func (i FSItemAttributes) Uid() uint32

The user identifier.

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes/uid

type FSItemAttributesClass

type FSItemAttributesClass struct {
	// contains filtered or unexported fields
}

func GetFSItemAttributesClass

func GetFSItemAttributesClass() FSItemAttributesClass

GetFSItemAttributesClass returns the class object for FSItemAttributes.

func (FSItemAttributesClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSItemAttributesClass) Class

func (fc FSItemAttributesClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSItemAttributesErrorHandler

type FSItemAttributesErrorHandler = func(*FSItemAttributes, error)

FSItemAttributesErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeOperations.GetAttributesOfItemReplyHandler]
  • [FSVolumeOperations.SetAttributesOnItemReplyHandler]

type FSItemClass

type FSItemClass struct {
	// contains filtered or unexported fields
}

func GetFSItemClass

func GetFSItemClass() FSItemClass

GetFSItemClass returns the class object for FSItem.

func (FSItemClass) Alloc

func (fc FSItemClass) Alloc() FSItem

Alloc allocates memory for a new instance of the class.

func (FSItemClass) Class

func (fc FSItemClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSItemDeactivationOptions

type FSItemDeactivationOptions int

See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivationOptions

const (
	// FSItemDeactivationAlways: An option to always perform deactivation calls.
	FSItemDeactivationAlways FSItemDeactivationOptions = -1
	// FSItemDeactivationForPreallocatedItems: An option to process deactivation for for files with preallocated space.
	FSItemDeactivationForPreallocatedItems FSItemDeactivationOptions = 2
	// FSItemDeactivationForRemovedItems: An option to process deactivation for open-unlinked items at the moment of last close.
	FSItemDeactivationForRemovedItems FSItemDeactivationOptions = 1
	// FSItemDeactivationNever: An option to never perform deactivation.
	FSItemDeactivationNever FSItemDeactivationOptions = 0
)

func (FSItemDeactivationOptions) String

func (e FSItemDeactivationOptions) String() string

type FSItemErrorHandler

type FSItemErrorHandler = func(*FSItem, error)

FSItemErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeOperations.ActivateWithOptionsReplyHandler]

type FSItemFSFileNameErrorHandler

type FSItemFSFileNameErrorHandler = func(*FSItem, *FSFileName, error)

FSItemFSFileNameErrorHandler handles A block or closure to indicate success or failure. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSVolumeKernelOffloadedIOOperations.CreateFileNamedInDirectoryAttributesPackerReplyHandler]
  • [FSVolumeKernelOffloadedIOOperations.LookupItemNamedInDirectoryPackerReplyHandler]
  • [FSVolumeOperations.CreateItemNamedTypeInDirectoryAttributesReplyHandler]
  • [FSVolumeOperations.CreateSymbolicLinkNamedInDirectoryAttributesLinkContentsReplyHandler]
  • [FSVolumeOperations.LookupItemNamedInDirectoryReplyHandler]

type FSItemGetAttributesRequest

type FSItemGetAttributesRequest struct {
	objectivec.Object
}

A request to get attributes from an item.

Overview

Methods that retrieve attributes use this type and inspect the FSItemGetAttributesRequest.WantedAttributes property to determine which attributes to provide. FSKit calls the FSItemGetAttributesRequest.IsAttributeWanted method to determine whether the request requires a given attribute.

Inspecting requested attributes

See: https://developer.apple.com/documentation/FSKit/FSItem/GetAttributesRequest

func FSItemGetAttributesRequestFromID

func FSItemGetAttributesRequestFromID(id objc.ID) FSItemGetAttributesRequest

FSItemGetAttributesRequestFromID constructs a FSItemGetAttributesRequest from an objc.ID.

A request to get attributes from an item.

func NewFSItemGetAttributesRequest

func NewFSItemGetAttributesRequest() FSItemGetAttributesRequest

NewFSItemGetAttributesRequest creates a new FSItemGetAttributesRequest instance.

func (FSItemGetAttributesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSItemGetAttributesRequest) EncodeWithCoder

func (i FSItemGetAttributesRequest) EncodeWithCoder(coder foundation.INSCoder)

func (FSItemGetAttributesRequest) Init

Init initializes the instance.

func (FSItemGetAttributesRequest) IsAttributeWanted

func (i FSItemGetAttributesRequest) IsAttributeWanted(attribute FSItemAttribute) bool

A method that indicates whether the request wants given attribute.

attribute: The FSItem.Attribute to check.

See: https://developer.apple.com/documentation/FSKit/FSItem/GetAttributesRequest/isAttributeWanted(_:)

func (FSItemGetAttributesRequest) SetWantedAttributes

func (i FSItemGetAttributesRequest) SetWantedAttributes(value FSItemAttribute)

func (FSItemGetAttributesRequest) WantedAttributes

func (i FSItemGetAttributesRequest) WantedAttributes() FSItemAttribute

The attributes requested by the request.

Discussion

This property is a bit field in Objective-C and an OptionSet in Swift.

See: https://developer.apple.com/documentation/FSKit/FSItem/GetAttributesRequest/wantedAttributes

type FSItemGetAttributesRequestClass

type FSItemGetAttributesRequestClass struct {
	// contains filtered or unexported fields
}

func GetFSItemGetAttributesRequestClass

func GetFSItemGetAttributesRequestClass() FSItemGetAttributesRequestClass

GetFSItemGetAttributesRequestClass returns the class object for FSItemGetAttributesRequest.

func (FSItemGetAttributesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSItemGetAttributesRequestClass) Class

Class returns the underlying Objective-C class pointer.

type FSItemID

type FSItemID uint64

See: https://developer.apple.com/documentation/FSKit/FSItem/Identifier

const (
	// FSItemIDInvalid: The identifier for an invalid item.
	FSItemIDInvalid FSItemID = 0
	// FSItemIDParentOfRoot: The identifier for an item that serves as the parent of the root directory.
	FSItemIDParentOfRoot FSItemID = 1
	// FSItemIDRootDirectory: The item identifier for the root directory.
	FSItemIDRootDirectory FSItemID = 2
)

func (FSItemID) String

func (e FSItemID) String() string

type FSItemSetAttributesRequest

type FSItemSetAttributesRequest struct {
	FSItemAttributes
}

A request to set attributes on an item.

Overview

Methods that take attributes use this type to receive attribute values and to indicate which attributes they support. The various members of the parent type, FSItemAttributes, contain the values of the attributes to set.

Modify the FSItemSetAttributesRequest.ConsumedAttributes property to indicate which attributes your file system successfully used. FSKit calls the FSItemSetAttributesRequest.WasAttributeConsumed method to determine whether the file system successfully used a given attribute. Only set the attributes that your file system supports.

Inspecting used attributes

See: https://developer.apple.com/documentation/FSKit/FSItem/SetAttributesRequest

func FSItemSetAttributesRequestFromID

func FSItemSetAttributesRequestFromID(id objc.ID) FSItemSetAttributesRequest

FSItemSetAttributesRequestFromID constructs a FSItemSetAttributesRequest from an objc.ID.

A request to set attributes on an item.

func NewFSItemSetAttributesRequest

func NewFSItemSetAttributesRequest() FSItemSetAttributesRequest

NewFSItemSetAttributesRequest creates a new FSItemSetAttributesRequest instance.

func (FSItemSetAttributesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSItemSetAttributesRequest) ConsumedAttributes

func (i FSItemSetAttributesRequest) ConsumedAttributes() FSItemAttribute

The attributes successfully used by the file system.

Discussion

This property is a bit field in Objective-C and an OptionSet in Swift.

See: https://developer.apple.com/documentation/FSKit/FSItem/SetAttributesRequest/consumedAttributes

func (FSItemSetAttributesRequest) Init

Init initializes the instance.

func (FSItemSetAttributesRequest) SetConsumedAttributes

func (i FSItemSetAttributesRequest) SetConsumedAttributes(value FSItemAttribute)

func (FSItemSetAttributesRequest) WasAttributeConsumed

func (i FSItemSetAttributesRequest) WasAttributeConsumed(attribute FSItemAttribute) bool

A method that indicates whether the file system used the given attribute.

attribute: The FSItem.Attribute to check.

See: https://developer.apple.com/documentation/FSKit/FSItem/SetAttributesRequest/wasAttributeConsumed(_:)

type FSItemSetAttributesRequestClass

type FSItemSetAttributesRequestClass struct {
	// contains filtered or unexported fields
}

func GetFSItemSetAttributesRequestClass

func GetFSItemSetAttributesRequestClass() FSItemSetAttributesRequestClass

GetFSItemSetAttributesRequestClass returns the class object for FSItemSetAttributesRequest.

func (FSItemSetAttributesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSItemSetAttributesRequestClass) Class

Class returns the underlying Objective-C class pointer.

type FSItemType

type FSItemType int

See: https://developer.apple.com/documentation/FSKit/FSItem/ItemType

const (
	// FSItemTypeBlockDevice: The item type of a block device.
	FSItemTypeBlockDevice FSItemType = 6
	// FSItemTypeCharDevice: The item type of a character device.
	FSItemTypeCharDevice FSItemType = 5
	// FSItemTypeDirectory: The item type of a directory.
	FSItemTypeDirectory FSItemType = 2
	// FSItemTypeFIFO: The item type of a first-in/first-out named pipe.
	FSItemTypeFIFO FSItemType = 4
	// FSItemTypeFile: The item type of a regular file.
	FSItemTypeFile FSItemType = 1
	// FSItemTypeSocket: The item type of a socket.
	FSItemTypeSocket FSItemType = 7
	// FSItemTypeSymlink: The item type of a symbolic link.
	FSItemTypeSymlink FSItemType = 3
	// FSItemTypeUnknown: The item type of an unknown item.
	FSItemTypeUnknown FSItemType = 0
)

func (FSItemType) String

func (e FSItemType) String() string

type FSManageableResourceMaintenanceOperations

type FSManageableResourceMaintenanceOperations interface {
	objectivec.IObject

	// Starts checking the file system with the given options.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSManageableResourceMaintenanceOperations/startCheck(task:options:)
	StartCheckWithTaskOptionsError(task IFSTask, options IFSTaskOptions) (foundation.Progress, error)

	// Starts formatting the file system with the given options.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSManageableResourceMaintenanceOperations/startFormat(task:options:)
	StartFormatWithTaskOptionsError(task IFSTask, options IFSTaskOptions) (foundation.Progress, error)
}

Maintenance operations for a file system’s resources.

See: https://developer.apple.com/documentation/FSKit/FSManageableResourceMaintenanceOperations

type FSManageableResourceMaintenanceOperationsObject

type FSManageableResourceMaintenanceOperationsObject struct {
	objectivec.Object
}

FSManageableResourceMaintenanceOperationsObject wraps an existing Objective-C object that conforms to the FSManageableResourceMaintenanceOperations protocol.

func FSManageableResourceMaintenanceOperationsObjectFromID

func FSManageableResourceMaintenanceOperationsObjectFromID(id objc.ID) FSManageableResourceMaintenanceOperationsObject

FSManageableResourceMaintenanceOperationsObjectFromID constructs a FSManageableResourceMaintenanceOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSManageableResourceMaintenanceOperationsObject) BaseObject

func (FSManageableResourceMaintenanceOperationsObject) StartCheckWithTaskOptionsError

func (o FSManageableResourceMaintenanceOperationsObject) StartCheckWithTaskOptionsError(task IFSTask, options IFSTaskOptions) (foundation.Progress, error)

Starts checking the file system with the given options.

task: A task object you use to communicate back to the client.

options: Options for performing the check.

Return Value

An Progress object that you use to update progress as the check operation progresses. Return `nil` if starting the file system check encountered an error.

See: https://developer.apple.com/documentation/FSKit/FSManageableResourceMaintenanceOperations/startCheck(task:options:)

func (FSManageableResourceMaintenanceOperationsObject) StartFormatWithTaskOptionsError

func (o FSManageableResourceMaintenanceOperationsObject) StartFormatWithTaskOptionsError(task IFSTask, options IFSTaskOptions) (foundation.Progress, error)

Starts formatting the file system with the given options.

task: A task object you use to communicate back to the client.

options: Options for performing the format.

Return Value

An Progress object that you use to update progress as the format operation progresses. Return `nil` if starting to format the file system encountered an error.

See: https://developer.apple.com/documentation/FSKit/FSManageableResourceMaintenanceOperations/startFormat(task:options:)

type FSMatchResult

type FSMatchResult int

See: https://developer.apple.com/documentation/FSKit/FSMatchResult

const (
	// FSMatchResultNotRecognized: The probe doesn’t recognize the resource.
	FSMatchResultNotRecognized FSMatchResult = 0
	// FSMatchResultRecognized: The probe recognizes the resource but can’t use it.
	FSMatchResultRecognized FSMatchResult = 1
	// FSMatchResultUsable: The probe recognizes the resource and is ready to use it.
	FSMatchResultUsable FSMatchResult = 3
	// FSMatchResultUsableButLimited: The probe recognizes the resource and is ready to use it, but only in a limited capacity.
	FSMatchResultUsableButLimited FSMatchResult = 2
)

func (FSMatchResult) String

func (e FSMatchResult) String() string

type FSMetadataRange

type FSMetadataRange struct {
	objectivec.Object
}

A range that describes contiguous metadata segments on disk.

Overview

This type represents a range that begins at `startOffset` and ends at `startOffset + segmentLength * segmentCount`. Each segment in the range represents a single block in the resource’s buffer cache.

For example, given an FSMetadataRange with the following properties:

- `startOffset = 0` - `segmentLength = 512` - `segmentCount = 8`

The range represents eight segments: from 0 to 511, then from 512 to 1023, and so on until a final segment of 3584 to 4095.

Ensure that each metadata segment represents a range that’s already present in the resource’s buffer cache. Similarly, ensure that each segment’s offset and length matches the offset and length of the corresponding block in the buffer cache.

Creating a metadata range

Accessing range properties

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange

func FSMetadataRangeFromID

func FSMetadataRangeFromID(id objc.ID) FSMetadataRange

FSMetadataRangeFromID constructs a FSMetadataRange from an objc.ID.

A range that describes contiguous metadata segments on disk.

func NewFSMetadataRange

func NewFSMetadataRange() FSMetadataRange

NewFSMetadataRange creates a new FSMetadataRange instance.

func NewMetadataRangeWithOffsetSegmentLengthSegmentCount

func NewMetadataRangeWithOffsetSegmentLengthSegmentCount(startOffset int64, segmentLength uint64, segmentCount uint64) FSMetadataRange

Initializes a metadata range with the given properties.

startOffset: The start offset of the range in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentLength: The segment length in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentCount: The number of segments in the range.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/init(offset:segmentLength:segmentCount:)

func (FSMetadataRange) Autorelease

func (m FSMetadataRange) Autorelease() FSMetadataRange

Autorelease adds the receiver to the current autorelease pool.

func (FSMetadataRange) Init

Init initializes the instance.

func (FSMetadataRange) InitWithOffsetSegmentLengthSegmentCount

func (m FSMetadataRange) InitWithOffsetSegmentLengthSegmentCount(startOffset int64, segmentLength uint64, segmentCount uint64) FSMetadataRange

Initializes a metadata range with the given properties.

startOffset: The start offset of the range in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentLength: The segment length in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentCount: The number of segments in the range.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/init(offset:segmentLength:segmentCount:)

func (FSMetadataRange) SegmentCount

func (m FSMetadataRange) SegmentCount() uint64

The number of segments in the range.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/segmentCount

func (FSMetadataRange) SegmentLength

func (m FSMetadataRange) SegmentLength() uint64

The segment length in bytes.

Discussion

Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/segmentLength

func (FSMetadataRange) StartOffset

func (m FSMetadataRange) StartOffset() int64

The start offset of the range in bytes.

Discussion

Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/startOffset

type FSMetadataRangeClass

type FSMetadataRangeClass struct {
	// contains filtered or unexported fields
}

func GetFSMetadataRangeClass

func GetFSMetadataRangeClass() FSMetadataRangeClass

GetFSMetadataRangeClass returns the class object for FSMetadataRange.

func (FSMetadataRangeClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSMetadataRangeClass) Class

func (fc FSMetadataRangeClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

func (FSMetadataRangeClass) RangeWithOffsetSegmentLengthSegmentCount

func (_FSMetadataRangeClass FSMetadataRangeClass) RangeWithOffsetSegmentLengthSegmentCount(startOffset int64, segmentLength uint64, segmentCount uint64) FSMetadataRange

Creates a metadata range with the given properties.

startOffset: The start offset of the range in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentLength: The segment length in bytes. Ensure this value is a multiple of the corresponding resource’s FSBlockDeviceResource.BlockSize.

segmentCount: The number of segments in the range.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange/rangeWithOffset:segmentLength:segmentCount:

type FSModuleIdentity

type FSModuleIdentity struct {
	objectivec.Object
}

An installed file system module.

Accessing module properties

See: https://developer.apple.com/documentation/FSKit/FSModuleIdentity

func FSModuleIdentityFromID

func FSModuleIdentityFromID(id objc.ID) FSModuleIdentity

FSModuleIdentityFromID constructs a FSModuleIdentity from an objc.ID.

An installed file system module.

func NewFSModuleIdentity

func NewFSModuleIdentity() FSModuleIdentity

NewFSModuleIdentity creates a new FSModuleIdentity instance.

func (FSModuleIdentity) Autorelease

func (m FSModuleIdentity) Autorelease() FSModuleIdentity

Autorelease adds the receiver to the current autorelease pool.

func (FSModuleIdentity) BundleIdentifier

func (m FSModuleIdentity) BundleIdentifier() string

The module’s bundle identifier.

See: https://developer.apple.com/documentation/FSKit/FSModuleIdentity/bundleIdentifier

func (FSModuleIdentity) Init

Init initializes the instance.

func (FSModuleIdentity) IsEnabled added in v0.6.5

func (m FSModuleIdentity) IsEnabled() bool

A Boolean value that indicates if the module is enabled.

See: https://developer.apple.com/documentation/FSKit/FSModuleIdentity/isEnabled

func (FSModuleIdentity) Url

The module’s URL.

See: https://developer.apple.com/documentation/FSKit/FSModuleIdentity/url

type FSModuleIdentityArrayErrorHandler

type FSModuleIdentityArrayErrorHandler = func(*[]FSModuleIdentity, error)

FSModuleIdentityArrayErrorHandler handles A block or closure that executes when FSKit finishes its fetch process. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type FSModuleIdentityClass

type FSModuleIdentityClass struct {
	// contains filtered or unexported fields
}

func GetFSModuleIdentityClass

func GetFSModuleIdentityClass() FSModuleIdentityClass

GetFSModuleIdentityClass returns the class object for FSModuleIdentity.

func (FSModuleIdentityClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSModuleIdentityClass) Class

func (fc FSModuleIdentityClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSMountOptions

type FSMountOptions uint

See: https://developer.apple.com/documentation/FSKit/FSVolume/MountOptions

const (
	// FSMountOptionsReadOnly: An option to request a read-only mount.
	FSMountOptionsReadOnly FSMountOptions = 1
)

func (FSMountOptions) String

func (e FSMountOptions) String() string

type FSMutableFileDataBuffer

type FSMutableFileDataBuffer struct {
	objectivec.Object
}

A wrapper object for a data buffer.

Overview

This object provides a “zero-copy” buffer, for use when reading data from files. By not requiring additional buffer copying, this object reduces the extension’s memory footprint and improves performance. The FSMutableFileDataBuffer behaves similarly to a `uio` in the kernel.

Accessing buffer properties

See: https://developer.apple.com/documentation/FSKit/FSMutableFileDataBuffer

func FSMutableFileDataBufferFromID

func FSMutableFileDataBufferFromID(id objc.ID) FSMutableFileDataBuffer

FSMutableFileDataBufferFromID constructs a FSMutableFileDataBuffer from an objc.ID.

A wrapper object for a data buffer.

func NewFSMutableFileDataBuffer

func NewFSMutableFileDataBuffer() FSMutableFileDataBuffer

NewFSMutableFileDataBuffer creates a new FSMutableFileDataBuffer instance.

func (FSMutableFileDataBuffer) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSMutableFileDataBuffer) Init

Init initializes the instance.

func (FSMutableFileDataBuffer) Length

func (m FSMutableFileDataBuffer) Length() uint

The data length of the buffer.

See: https://developer.apple.com/documentation/FSKit/FSMutableFileDataBuffer/length

type FSMutableFileDataBufferClass

type FSMutableFileDataBufferClass struct {
	// contains filtered or unexported fields
}

func GetFSMutableFileDataBufferClass

func GetFSMutableFileDataBufferClass() FSMutableFileDataBufferClass

GetFSMutableFileDataBufferClass returns the class object for FSMutableFileDataBuffer.

func (FSMutableFileDataBufferClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSMutableFileDataBufferClass) Class

Class returns the underlying Objective-C class pointer.

type FSOperationID

type FSOperationID = uint

FSOperationID is a unique identifier for an operation.

See: https://developer.apple.com/documentation/FSKit/FSOperationID

type FSPathURLResource

type FSPathURLResource struct {
	FSResource
}

A resource that represents a path in the system file space.

Overview

The URL passed to FSPathURLResource may be a security-scoped URL. If the URL is a security-scoped URL, FSKit transports it intact from a client application to your extension.

Creating a path URL resource

Accessing resource properties

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource

func FSPathURLResourceFromID

func FSPathURLResourceFromID(id objc.ID) FSPathURLResource

FSPathURLResourceFromID constructs a FSPathURLResource from an objc.ID.

A resource that represents a path in the system file space.

func NewFSPathURLResource

func NewFSPathURLResource() FSPathURLResource

NewFSPathURLResource creates a new FSPathURLResource instance.

func NewPathURLResourceWithURLWritable

func NewPathURLResourceWithURLWritable(URL foundation.NSURL, writable bool) FSPathURLResource

Creates a path URL resource.

URL: A URL in the system file space that represents the contents of a file system. This parameter uses the “ scheme.

writable: A Boolean value that indicates whether the file system supports writing to the contents of the URL.

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource/init(url:writable:)-2l10q

func (FSPathURLResource) Autorelease

func (p FSPathURLResource) Autorelease() FSPathURLResource

Autorelease adds the receiver to the current autorelease pool.

func (FSPathURLResource) Init

Init initializes the instance.

func (FSPathURLResource) InitWithURLWritable

func (p FSPathURLResource) InitWithURLWritable(URL foundation.NSURL, writable bool) FSPathURLResource

Creates a path URL resource.

URL: A URL in the system file space that represents the contents of a file system. This parameter uses the “ scheme.

writable: A Boolean value that indicates whether the file system supports writing to the contents of the URL.

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource/init(url:writable:)-2l10q

func (FSPathURLResource) IsWritable added in v0.6.5

func (p FSPathURLResource) IsWritable() bool

A Boolean value that indicates whether the file system supports writing to the contents of the path URL.

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource/isWritable

func (FSPathURLResource) Url

The URL represented by the resource.

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource/url

type FSPathURLResourceClass

type FSPathURLResourceClass struct {
	// contains filtered or unexported fields
}

func GetFSPathURLResourceClass

func GetFSPathURLResourceClass() FSPathURLResourceClass

GetFSPathURLResourceClass returns the class object for FSPathURLResource.

func (FSPathURLResourceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSPathURLResourceClass) Class

func (fc FSPathURLResourceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSPreallocateFlags

type FSPreallocateFlags uint

See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateFlags

const (
	// FSPreallocateFlagsAll: Allocates all requested space or no space at all.
	FSPreallocateFlagsAll FSPreallocateFlags = 0x4
	// FSPreallocateFlagsContiguous: Allocates contiguous space.
	FSPreallocateFlagsContiguous FSPreallocateFlags = 0x2
	// FSPreallocateFlagsFromEOF: Allocates space from the physical end of file.
	FSPreallocateFlagsFromEOF FSPreallocateFlags = 0x10
	// FSPreallocateFlagsPersist: Allocates space that isn’t freed when deleting the descriptor.
	FSPreallocateFlagsPersist FSPreallocateFlags = 0x8
)

func (FSPreallocateFlags) String

func (e FSPreallocateFlags) String() string

type FSProbeResult

type FSProbeResult struct {
	objectivec.Object
}

An object that represents the results of a specific probe.

Overview

For any FSProbeResult.Result value other than FSMatchResultNotRecognized, ensure the FSProbeResult.Name and FSProbeResult.ContainerID values are non-`nil`. When a container or volume format doesn’t use a name, return an empty string. Also use an empty string in the case in which the format supports a name, but the value isn’t set yet.

Some container or volume formats may lack a durable UUID on which to base a container identifier. This situation is only valid for unary file systems. In such a case, return a random UUID.

With a block device resource, a probe operation may successfully get a result but encounter an error reading the name or UUID. If this happens, use whatever information is available, and provide an empty string or random UUID for the name or container ID, respectively.

Working with result properties

Initializers

See: https://developer.apple.com/documentation/FSKit/FSProbeResult

func FSProbeResultFromID

func FSProbeResultFromID(id objc.ID) FSProbeResult

FSProbeResultFromID constructs a FSProbeResult from an objc.ID.

An object that represents the results of a specific probe.

func NewFSProbeResult

func NewFSProbeResult() FSProbeResult

NewFSProbeResult creates a new FSProbeResult instance.

func (FSProbeResult) Autorelease

func (p FSProbeResult) Autorelease() FSProbeResult

Autorelease adds the receiver to the current autorelease pool.

func (FSProbeResult) ContainerID

func (p FSProbeResult) ContainerID() IFSContainerIdentifier

The container identifier, as found during the probe operation.

Discussion

This value is non-`nil` unless the result is FSMatchResultNotRecognized. For formats that lack a durable UUID on which to base a container identifier — which is only legal for a FSUnaryFileSystem — this value may be a random UUID.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/containerID

func (FSProbeResult) EncodeWithCoder

func (p FSProbeResult) EncodeWithCoder(coder foundation.INSCoder)

func (FSProbeResult) Init

func (p FSProbeResult) Init() FSProbeResult

Init initializes the instance.

func (FSProbeResult) Name

func (p FSProbeResult) Name() string

The resource name, as found during the probe operation.

Discussion

This value is non-`nil` unless the FSProbeResult.Result is “FSMatchResult/notRecognized`. For formats that lack a name, this value may be an empty string. This value can also be an empty string if the format supports a name, but the value isn’t set yet.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/name

func (FSProbeResult) Result

func (p FSProbeResult) Result() FSMatchResult

The match result, representing the recognition and usability of a probed resource.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/result

type FSProbeResultClass

type FSProbeResultClass struct {
	// contains filtered or unexported fields
}

func GetFSProbeResultClass

func GetFSProbeResultClass() FSProbeResultClass

GetFSProbeResultClass returns the class object for FSProbeResult.

func (FSProbeResultClass) Alloc

func (fc FSProbeResultClass) Alloc() FSProbeResult

Alloc allocates memory for a new instance of the class.

func (FSProbeResultClass) Class

func (fc FSProbeResultClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

func (FSProbeResultClass) NotRecognizedProbeResult

func (_FSProbeResultClass FSProbeResultClass) NotRecognizedProbeResult() FSProbeResult

A probe result for an unrecognized file system.

Discussion

An unrecognized probe result contains `nil` for its FSProbeResult.Name and FSProbeResult.ContainerID properties.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/notRecognized

func (FSProbeResultClass) RecognizedProbeResultWithNameContainerID

func (_FSProbeResultClass FSProbeResultClass) RecognizedProbeResultWithNameContainerID(name string, containerID IFSContainerIdentifier) FSProbeResult

Creates a probe result for a recognized file system.

name: The resource name, as found during the probe operation. If the file system doesn’t support names, or is awaiting naming, use an empty string.

containerID: The container identifier, as found during the probe operation. If the file system doesn’t support durable identifiers, use a random UUID.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/recognized(name:containerID:)

func (FSProbeResultClass) UsableButLimitedProbeResult

func (_FSProbeResultClass FSProbeResultClass) UsableButLimitedProbeResult() FSProbeResult

A probe result for a recognized file system that is usable, but with limited capabilities.

Discussion

This kind of probe result lacks the FSProbeResult.Name, FSProbeResult.ContainerID, or both. Don’t return this result from probing a resource that isn’t limited.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/usableButLimited

func (FSProbeResultClass) UsableButLimitedProbeResultWithNameContainerID

func (_FSProbeResultClass FSProbeResultClass) UsableButLimitedProbeResultWithNameContainerID(name string, containerID IFSContainerIdentifier) FSProbeResult

Creates a probe result for a recognized file system that is usable, but with limited capabilities.

name: The resource name, as found during the probe operation. If the file system doesn’t support names, or is awaiting naming, use an empty string.

containerID: The container identifier, as found during the probe operation. If the file system doesn’t support durable identifiers, use a random UUID.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/usableButLimited(name:containerID:)

func (FSProbeResultClass) UsableProbeResultWithNameContainerID

func (_FSProbeResultClass FSProbeResultClass) UsableProbeResultWithNameContainerID(name string, containerID IFSContainerIdentifier) FSProbeResult

Creates a probe result for a recognized and usable file system.

name: The resource name, as found during the probe operation. If the file system doesn’t support names, or is awaiting naming, use an empty string.

containerID: The container identifier, as found during the probe operation. If the file system doesn’t support durable identifiers, use a random UUID.

See: https://developer.apple.com/documentation/FSKit/FSProbeResult/usable(name:containerID:)

type FSProbeResultErrorHandler

type FSProbeResultErrorHandler = func(*FSProbeResult, error)

FSProbeResultErrorHandler handles A block or closure that your implementation invokes when it finishes the probe or encounters an error. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSUnaryFileSystemOperations.ProbeResourceReplyHandler]

type FSResource

type FSResource struct {
	objectivec.Object
}

An abstract resource a file system uses to provide data for a volume.

Overview

FSResource is a base class to represent the various possible sources of data for a file system. These range from dedicated storage devices like hard drives and flash storage to network connections, and beyond. Subclasses define behavior specific to a given kind of resource, such as FSBlockDeviceResource for disk partition (IOMedia) file systems. These file systems are typical disk file systems such as HFS, APFS, ExFAT, ext2fs, or NTFS.

A resource’s type also determines its life cycle. Resources based on block storage devices come into being when the system probes the media underlying the volumes and container. Other kinds of resources, like those based on URLs, might have different life cycles. For example, a resource based on a `//` URL might initialize when a person uses the “Connect to server” command in the macOS Finder.

Proxying resources

Some resources, like FSBlockDeviceResource, come in proxy and non-proxy variants. This addresses the issue that opening an external device like `/dev/disk2s1` requires an entitlement. Proxy resources allow unentitled clients of FSKit to describe which disk an FSBlockDeviceResource should represent. This allows, for example, the `mount(8)` tool to mount FSKit file systems on block devices when run as root. The tool uses a proxy when executing a command like `mount -t ffs /dev/disk2s1 /some/path`, which prevents leaking privileged resource access.

Creating proxies

Revoking the resource

Initializers

See: https://developer.apple.com/documentation/FSKit/FSResource

func FSResourceFromID

func FSResourceFromID(id objc.ID) FSResource

FSResourceFromID constructs a FSResource from an objc.ID.

An abstract resource a file system uses to provide data for a volume.

func NewFSResource

func NewFSResource() FSResource

NewFSResource creates a new FSResource instance.

func (FSResource) Autorelease

func (r FSResource) Autorelease() FSResource

Autorelease adds the receiver to the current autorelease pool.

func (FSResource) EncodeWithCoder

func (r FSResource) EncodeWithCoder(coder foundation.INSCoder)

func (FSResource) Init

func (r FSResource) Init() FSResource

Init initializes the instance.

func (FSResource) IsRevoked added in v0.6.5

func (r FSResource) IsRevoked() bool

A Boolean value that indicates whether the resource is revoked.

Discussion

If this is a proxy resource, the value of this property is always `true` (Swift) or [YES] (Objective-C).

See: https://developer.apple.com/documentation/FSKit/FSResource/isRevoked

func (FSResource) MakeProxy

func (r FSResource) MakeProxy() IFSResource

Creates a proxy object of this resource.

Discussion

If you create a proxy from a proxy resource, this method returns a copy of the proxy.

See: https://developer.apple.com/documentation/FSKit/FSResource/makeProxy()

func (FSResource) Revoke

func (r FSResource) Revoke()

Revokes the resource.

Discussion

This method works by stripping away any underlying privileges associated with the resource. This effectively disconnects this object from its underlying resource.

See: https://developer.apple.com/documentation/FSKit/FSResource/revoke()

type FSResourceClass

type FSResourceClass struct {
	// contains filtered or unexported fields
}

func GetFSResourceClass

func GetFSResourceClass() FSResourceClass

GetFSResourceClass returns the class object for FSResource.

func (FSResourceClass) Alloc

func (fc FSResourceClass) Alloc() FSResource

Alloc allocates memory for a new instance of the class.

func (FSResourceClass) Class

func (fc FSResourceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSSetXattrPolicy

type FSSetXattrPolicy uint

See: https://developer.apple.com/documentation/FSKit/FSVolume/SetXattrPolicy

const (
	// FSSetXattrPolicyAlwaysSet: Set the value, regardless of previous state.
	FSSetXattrPolicyAlwaysSet FSSetXattrPolicy = 0
	// FSSetXattrPolicyDelete: Delete the value, failing if the extended attribute doesn’t exist.
	FSSetXattrPolicyDelete FSSetXattrPolicy = 3
	// FSSetXattrPolicyMustCreate: Set the value, but fail if the extended attribute already exists.
	FSSetXattrPolicyMustCreate FSSetXattrPolicy = 1
	// FSSetXattrPolicyMustReplace: Set the value, but fail if the extended attribute doesn’t already exist.
	FSSetXattrPolicyMustReplace FSSetXattrPolicy = 2
)

func (FSSetXattrPolicy) String

func (e FSSetXattrPolicy) String() string

type FSStatFSResult

type FSStatFSResult struct {
	objectivec.Object
}

A type used to report a volume’s statistics.

Overview

The names of this type’s properties match those in the `statfs` structure in `statfs(2)`, which reports these values for an FSKit file system. All numeric properties default to `0`. Override these values, unless a given property has no meaningful value to provide.

For the read-only FSStatFSResult.FileSystemTypeName, set this value with the designated initializer.

Initializers

Instance Properties

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult

func FSStatFSResultFromID

func FSStatFSResultFromID(id objc.ID) FSStatFSResult

FSStatFSResultFromID constructs a FSStatFSResult from an objc.ID.

A type used to report a volume’s statistics.

func NewFSStatFSResult

func NewFSStatFSResult() FSStatFSResult

NewFSStatFSResult creates a new FSStatFSResult instance.

func NewStatFSResultWithFileSystemTypeName

func NewStatFSResultWithFileSystemTypeName(fileSystemTypeName string) FSStatFSResult

Creates an statistics result instance, using the given file system type name.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/init(fileSystemTypeName:)

func (FSStatFSResult) Autorelease

func (s FSStatFSResult) Autorelease() FSStatFSResult

Autorelease adds the receiver to the current autorelease pool.

func (FSStatFSResult) AvailableBlocks

func (s FSStatFSResult) AvailableBlocks() uint64

A property for the number of free blocks available to a non-superuser on the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/availableBlocks

func (FSStatFSResult) AvailableBytes

func (s FSStatFSResult) AvailableBytes() uint64

A property for the amount of space available to users, in bytes, in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/availableBytes

func (FSStatFSResult) BlockSize

func (s FSStatFSResult) BlockSize() int

A property for the volume’s block size, in bytes.

Discussion

This value defaults to `4096`. Zero isn’t a valid block size.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/blockSize

func (FSStatFSResult) EncodeWithCoder

func (s FSStatFSResult) EncodeWithCoder(coder foundation.INSCoder)

func (FSStatFSResult) FileSystemSubType

func (s FSStatFSResult) FileSystemSubType() int

A property for the file system’s subtype or flavor.

Discussion

Match this value to the [FSPersonalities]‘s [FSSubType] attribute, if it exists within the [EXAppExtensionAttributes] dictionary of the module’s `Info.Plist()`.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/fileSystemSubType

func (FSStatFSResult) FileSystemTypeName

func (s FSStatFSResult) FileSystemTypeName() string

A property for the file system type name.

Discussion

Match this value to the [FSShortName] attribute within the [EXAppExtensionAttributes] dictionary of the module’s `Info.Plist()`. The maximum allowed length is [MFSTYPENAMELEN], including the terminating [NUL] character.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/fileSystemTypeName

func (FSStatFSResult) FreeBlocks

func (s FSStatFSResult) FreeBlocks() uint64

A property for the number of free blocks in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/freeBlocks

func (FSStatFSResult) FreeBytes

func (s FSStatFSResult) FreeBytes() uint64

A property for the amount of free space, in bytes, in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/freeBytes

func (FSStatFSResult) FreeFiles

func (s FSStatFSResult) FreeFiles() uint64

A property for the total number of free file slots in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/freeFiles

func (FSStatFSResult) Init

func (s FSStatFSResult) Init() FSStatFSResult

Init initializes the instance.

func (FSStatFSResult) InitWithFileSystemTypeName

func (s FSStatFSResult) InitWithFileSystemTypeName(fileSystemTypeName string) FSStatFSResult

Creates an statistics result instance, using the given file system type name.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/init(fileSystemTypeName:)

func (FSStatFSResult) IoSize

func (s FSStatFSResult) IoSize() int

A property for the optimal block size with which to perform I/O.

Discussion

For best performance, specify an `ioSize` that’s an even multiple of FSStatFSResult.BlockSize.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/ioSize

func (FSStatFSResult) SetAvailableBlocks

func (s FSStatFSResult) SetAvailableBlocks(value uint64)

func (FSStatFSResult) SetAvailableBytes

func (s FSStatFSResult) SetAvailableBytes(value uint64)

func (FSStatFSResult) SetBlockSize

func (s FSStatFSResult) SetBlockSize(value int)

func (FSStatFSResult) SetFileSystemSubType

func (s FSStatFSResult) SetFileSystemSubType(value int)

func (FSStatFSResult) SetFreeBlocks

func (s FSStatFSResult) SetFreeBlocks(value uint64)

func (FSStatFSResult) SetFreeBytes

func (s FSStatFSResult) SetFreeBytes(value uint64)

func (FSStatFSResult) SetFreeFiles

func (s FSStatFSResult) SetFreeFiles(value uint64)

func (FSStatFSResult) SetIoSize

func (s FSStatFSResult) SetIoSize(value int)

func (FSStatFSResult) SetTotalBlocks

func (s FSStatFSResult) SetTotalBlocks(value uint64)

func (FSStatFSResult) SetTotalBytes

func (s FSStatFSResult) SetTotalBytes(value uint64)

func (FSStatFSResult) SetTotalFiles

func (s FSStatFSResult) SetTotalFiles(value uint64)

func (FSStatFSResult) SetUsedBlocks

func (s FSStatFSResult) SetUsedBlocks(value uint64)

func (FSStatFSResult) SetUsedBytes

func (s FSStatFSResult) SetUsedBytes(value uint64)

func (FSStatFSResult) TotalBlocks

func (s FSStatFSResult) TotalBlocks() uint64

A property for the volume’s total data block count.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/totalBlocks

func (FSStatFSResult) TotalBytes

func (s FSStatFSResult) TotalBytes() uint64

A property for the total size, in bytes, of the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/totalBytes

func (FSStatFSResult) TotalFiles

func (s FSStatFSResult) TotalFiles() uint64

A property for the total number of file slots in the volume,

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/totalFiles

func (FSStatFSResult) UsedBlocks

func (s FSStatFSResult) UsedBlocks() uint64

A property for the number of used blocks in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/usedBlocks

func (FSStatFSResult) UsedBytes

func (s FSStatFSResult) UsedBytes() uint64

A property for the amount of used space, in bytes, in the volume.

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult/usedBytes

type FSStatFSResultClass

type FSStatFSResultClass struct {
	// contains filtered or unexported fields
}

func GetFSStatFSResultClass

func GetFSStatFSResultClass() FSStatFSResultClass

GetFSStatFSResultClass returns the class object for FSStatFSResult.

func (FSStatFSResultClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSStatFSResultClass) Class

func (fc FSStatFSResultClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSSyncFlags

type FSSyncFlags int

See: https://developer.apple.com/documentation/FSKit/FSSyncFlags

const (
	// FSSyncFlagsDWait: A flag for synchronized I/O with data-integrity completion.
	FSSyncFlagsDWait FSSyncFlags = 4
	// FSSyncFlagsNoWait: A flag for synchronized I/O that starts I/O but doesn’t wait for it.
	FSSyncFlagsNoWait FSSyncFlags = 2
	// FSSyncFlagsWait: A flag for synchronized I/O with file-integrity completion.
	FSSyncFlagsWait FSSyncFlags = 1
)

func (FSSyncFlags) String

func (e FSSyncFlags) String() string

type FSTask

type FSTask struct {
	objectivec.Object
}

A class that enables a file system module to pass log messages and completion notifications to clients.

Overview

FSKit creates an instance of this class for each long-running operations.

Logging

Sending completion messages

Handling task cancellation

See: https://developer.apple.com/documentation/FSKit/FSTask

func FSTaskFromID

func FSTaskFromID(id objc.ID) FSTask

FSTaskFromID constructs a FSTask from an objc.ID.

A class that enables a file system module to pass log messages and completion notifications to clients.

func NewFSTask

func NewFSTask() FSTask

NewFSTask creates a new FSTask instance.

func (FSTask) Autorelease

func (t FSTask) Autorelease() FSTask

Autorelease adds the receiver to the current autorelease pool.

func (FSTask) CancellationHandler

func (t FSTask) CancellationHandler() VoidHandler

A handler called by FSKit upon canceling the task.

Discussion

FSKit calls the cancellation handler within an independent execution context.

If the handler can’t complete its work successfully, it can return an error from the block or closure. FSKit logs any returned error and then terminates all activity in the container.

The task object clears its `cancellationHandler` property after the task’s cancellation or completion. This helps accelerate the cleanup of retained state.

The exact structuring of the completion handler depends on the structuring of the code imlementing the task. As a concrete example, consider a check operation with the following class:

and a `startCheckWithTask` method with a helper method `performCheck` like the following:

When canceled, the handler block in this example sets the checker’s `interrupted` property, and then calls the DispatchGroup method wait() (Swift) or the function dispatch_group_wait (Objective-C) on the checker’s work group. Because neither of these operations can fail, the handler returns `nil` to indicate it didn’t encounter an error.

For simplicity, this example doesn’t account for errors, whereas production code must do so. Furthermore, when fully implemented, the `performCheck` method should perform a check operation. Specifically, it should periodically update the progress object and check its `interrupted` variable. The check can either complete successfully, complete with an error, or enter the interrupted state. It should then call FSTask.DidCompleteWithError wtih the appropriate error value or `nil`. Finally it should call `context.Work_groupXCUIElementTypeLeave()` (Swift) or `dispatch_group_leave(context.Work_group())` (Objective-C) to remove itself from its dispatch group.

See: https://developer.apple.com/documentation/FSKit/FSTask/cancellationHandler

func (FSTask) DidCompleteWithError

func (t FSTask) DidCompleteWithError(error_ foundation.NSError)

Informs the client that the task completed.

error: `nil` if the task completed successfully; otherwise, an error that caused the task to fail.

See: https://developer.apple.com/documentation/FSKit/FSTask/didComplete(error:)

func (FSTask) Init

func (t FSTask) Init() FSTask

Init initializes the instance.

func (FSTask) LogMessage

func (t FSTask) LogMessage(str string)

Logs the given string to the initiating client.

str: The string to log.

See: https://developer.apple.com/documentation/FSKit/FSTask/logMessage(_:)

func (FSTask) SetCancellationHandler

func (t FSTask) SetCancellationHandler(value VoidHandler)

type FSTaskClass

type FSTaskClass struct {
	// contains filtered or unexported fields
}

func GetFSTaskClass

func GetFSTaskClass() FSTaskClass

GetFSTaskClass returns the class object for FSTask.

func (FSTaskClass) Alloc

func (fc FSTaskClass) Alloc() FSTask

Alloc allocates memory for a new instance of the class.

func (FSTaskClass) Class

func (fc FSTaskClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSTaskOptions

type FSTaskOptions struct {
	objectivec.Object
}

A class that passes command options to a task, optionally providing security-scoped URLs.

Retrieving task options

Retrieving task option URLs

See: https://developer.apple.com/documentation/FSKit/FSTaskOptions

func FSTaskOptionsFromID

func FSTaskOptionsFromID(id objc.ID) FSTaskOptions

FSTaskOptionsFromID constructs a FSTaskOptions from an objc.ID.

A class that passes command options to a task, optionally providing security-scoped URLs.

func NewFSTaskOptions

func NewFSTaskOptions() FSTaskOptions

NewFSTaskOptions creates a new FSTaskOptions instance.

func (FSTaskOptions) Autorelease

func (t FSTaskOptions) Autorelease() FSTaskOptions

Autorelease adds the receiver to the current autorelease pool.

func (FSTaskOptions) Init

func (t FSTaskOptions) Init() FSTaskOptions

Init initializes the instance.

func (FSTaskOptions) TaskOptions

func (t FSTaskOptions) TaskOptions() []string

An array of strings that represent command-line options for the task.

Discussion

This property is equivalent to the `argv` array of C strings passed to a command-line tool.

See: https://developer.apple.com/documentation/FSKit/FSTaskOptions/taskOptions

func (FSTaskOptions) UrlForOption

func (t FSTaskOptions) UrlForOption(option string) foundation.NSURL

Retrieves a URL for a given option.

option: The option for which to retrieve the URL. This value doesn’t include leading dashes.

Discussion

Some command-line options refer to paths that indicate a location in which the module needs access to a file outside of its container. FSKit passes these paths as a URL tagged by the option name.

For example, `"-B" "./someFile"` returns the URL for `./someFile` when passed an option `"B"`. To indicate that your module treats a given option as a path, include it in the `pathOptions` dictionary within a command options dictionary ([FSActivatOptionSyntax], [FSCheckOptionSyntax], or [FSFormatOptionSyntax]). This dictionary uses the command option name as a key, and each entry has a value indicating what kind of entry to create.

See: https://developer.apple.com/documentation/FSKit/FSTaskOptions/url(forOption:)

type FSTaskOptionsClass

type FSTaskOptionsClass struct {
	// contains filtered or unexported fields
}

func GetFSTaskOptionsClass

func GetFSTaskOptionsClass() FSTaskOptionsClass

GetFSTaskOptionsClass returns the class object for FSTaskOptions.

func (FSTaskOptionsClass) Alloc

func (fc FSTaskOptionsClass) Alloc() FSTaskOptions

Alloc allocates memory for a new instance of the class.

func (FSTaskOptionsClass) Class

func (fc FSTaskOptionsClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSUnaryFileSystem

type FSUnaryFileSystem struct {
	objectivec.Object
}

An abstract base class for implementing a minimal file system.

Overview

FSUnaryFileSystem is a simplified file system, which works with one FSResource and presents it as one FSVolume.

The one volume and its container have a shared state and lifetime, a more constrained life cycle than the FSFileSystem design flow.

Implement your app extension by providing a subclass of FSUnaryFileSystem as a delegate object. Your delegate also needs to implement the FSUnaryFileSystemOperations protocol so that it can load resources.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystem

func FSUnaryFileSystemFromID

func FSUnaryFileSystemFromID(id objc.ID) FSUnaryFileSystem

FSUnaryFileSystemFromID constructs a FSUnaryFileSystem from an objc.ID.

An abstract base class for implementing a minimal file system.

func NewFSUnaryFileSystem

func NewFSUnaryFileSystem() FSUnaryFileSystem

NewFSUnaryFileSystem creates a new FSUnaryFileSystem instance.

func (FSUnaryFileSystem) Autorelease

func (u FSUnaryFileSystem) Autorelease() FSUnaryFileSystem

Autorelease adds the receiver to the current autorelease pool.

func (FSUnaryFileSystem) ContainerStatus

func (u FSUnaryFileSystem) ContainerStatus() IFSContainerStatus

The status of the file system container, indicating its readiness and activity.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus

func (FSUnaryFileSystem) Init

Init initializes the instance.

func (FSUnaryFileSystem) SetContainerStatus

func (o FSUnaryFileSystem) SetContainerStatus(value IFSContainerStatus)

The status of the file system container, indicating its readiness and activity.

Discussion

A file system container starts in the FSContainerStateNotReady state, and then transitions to the other values of the FSContainerState enumeration. The following diagram illustrates the possible state transitions.

[fs-file-system-base]

Your file system implementation updates this property as it changes state. Many events and operations may trigger a state transition, and some transitions depend on a specific file system’s design.

When using FSBlockDeviceResource, implement the following common state transitions:

- Calling `loadResource` transitions the state out of FSContainerStateNotReady. For all block device file systems, this operation changes the state to either FSContainerStateReady or FSContainerStateBlocked. - Calling `unloadResource` transitions to the FSContainerStateNotReady state, as does device termination. - Transitioning from FSContainerStateBlocked to FSContainerStateReady occurs as a result of resolving the underlying block favorably. - Transitioning from FSContainerStateReady to FSContainerStateBlocked is unusal, but valid. - Transitioning between FSContainerStateReady and FSContainerStateActive can result from maintenance operations such as [StartCheckWithTaskOptionsError]. For a FSUnaryFileSystem, this transition can also occur when activating or deactivating the container’s single volume.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/containerStatus

func (FSUnaryFileSystem) WipeResource

func (u FSUnaryFileSystem) WipeResource(ctx context.Context, resource IFSBlockDeviceResource) error

WipeResource is a synchronous wrapper around FSUnaryFileSystem.WipeResourceCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (FSUnaryFileSystem) WipeResourceCompletionHandler

func (u FSUnaryFileSystem) WipeResourceCompletionHandler(resource IFSBlockDeviceResource, completion ErrorHandler)

Wipes existing file systems on the specified resource.

resource: The FSBlockDeviceResource to wipe.

completion: A block or closure that executes after the wipe operation completes. The completion handler receives a single parameter indicating any error that occurs during the operation. If the value is `nil`, the wipe operation succeeded.

Discussion

This method wraps the `wipefs` functionality from `libutil`. For more information, see the `man` page for `wipefs`.

See: https://developer.apple.com/documentation/FSKit/FSFileSystemBase/wipe(_:completionHandler:)

type FSUnaryFileSystemClass

type FSUnaryFileSystemClass struct {
	// contains filtered or unexported fields
}

func GetFSUnaryFileSystemClass

func GetFSUnaryFileSystemClass() FSUnaryFileSystemClass

GetFSUnaryFileSystemClass returns the class object for FSUnaryFileSystem.

func (FSUnaryFileSystemClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSUnaryFileSystemClass) Class

func (fc FSUnaryFileSystemClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSUnaryFileSystemOperations

type FSUnaryFileSystemOperations interface {
	objectivec.IObject

	// Requests that the file system load a resource and present it as a volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/loadResource(resource:options:replyHandler:)
	LoadResourceOptionsReplyHandler(resource IFSResource, options IFSTaskOptions, reply FSVolumeErrorHandler)

	// Requests that the file system unload the specified resource.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/unloadResource(resource:options:replyHandler:)
	UnloadResourceOptionsReplyHandler(resource IFSResource, options IFSTaskOptions, reply ErrorHandler)

	// Requests that the file system probe the specified resource.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/probeResource(resource:replyHandler:)
	ProbeResourceReplyHandler(resource IFSResource, reply FSProbeResultErrorHandler)
}

Operations performed by a unary file system.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations

type FSUnaryFileSystemOperationsObject

type FSUnaryFileSystemOperationsObject struct {
	objectivec.Object
}

FSUnaryFileSystemOperationsObject wraps an existing Objective-C object that conforms to the FSUnaryFileSystemOperations protocol.

func FSUnaryFileSystemOperationsObjectFromID

func FSUnaryFileSystemOperationsObjectFromID(id objc.ID) FSUnaryFileSystemOperationsObject

FSUnaryFileSystemOperationsObjectFromID constructs a FSUnaryFileSystemOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSUnaryFileSystemOperationsObject) BaseObject

func (FSUnaryFileSystemOperationsObject) DidFinishLoading

func (o FSUnaryFileSystemOperationsObject) DidFinishLoading()

Notifies you that the system finished loading your file system extension.

Discussion

The system performs this callback after the main run loop starts and before receiving the first message from the FSKit daemon.

Implement this method if you want to perform any setup prior to receiving FSKit callbacks.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/didFinishLoading()

func (FSUnaryFileSystemOperationsObject) LoadResourceOptionsReplyHandler

func (o FSUnaryFileSystemOperationsObject) LoadResourceOptionsReplyHandler(resource IFSResource, options IFSTaskOptions, reply FSVolumeErrorHandler)

Requests that the file system load a resource and present it as a volume.

resource: An FSResource to load.

options: An FSTaskOptions object specifying options to apply when loading the resource. An FSUnaryFileSystem supports two options: `-f` for “force” and `--rdonly` for read-only. The file system must remember if the read-only option is present.

reply: A block or closure that your implementation invokes when it finishes setting up or encounters an error. Pass a subclass of FSVolume as the first parameter if loading succeeds. If loading fails, pass an error as the second parameter.

Discussion

Implement this method by inspecting the provided resource and verifying it uses a supported format. If the resource does use a supported format, create a subclass of FSVolume, clear the container error state, and invoke the `reply` callback, passing your volume as a parameter. If loading can’t proceed, invoke `reply` and send an appropriate error as the second parameter.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/loadResource(resource:options:replyHandler:)

func (FSUnaryFileSystemOperationsObject) ProbeResourceReplyHandler

func (o FSUnaryFileSystemOperationsObject) ProbeResourceReplyHandler(resource IFSResource, reply FSProbeResultErrorHandler)

Requests that the file system probe the specified resource.

resource: The FSResource to probe.

reply: A block or closure that your implementation invokes when it finishes the probe or encounters an error. Pass an instance of FSProbeResult with probe results as the first parameter if your probe operation succeeds. If probing fails, pass an error as the second parameter.

Discussion

Implement this method to indicate whether the resource is recognizable and usable.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/probeResource(resource:replyHandler:)

func (FSUnaryFileSystemOperationsObject) UnloadResourceOptionsReplyHandler

func (o FSUnaryFileSystemOperationsObject) UnloadResourceOptionsReplyHandler(resource IFSResource, options IFSTaskOptions, reply ErrorHandler)

Requests that the file system unload the specified resource.

resource: An FSResource to unload.

options: An FSTaskOptions object specifying options to apply when unloading the resource.

reply: A block or closure that your implementation invokes when it finishes unloading or encounters an error. If unloading fails, pass an error as the parameter to describe the problem. Otherwise, pass `nil`.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystemOperations/unloadResource(resource:options:replyHandler:)

type FSVolume

type FSVolume struct {
	objectivec.Object
}

A directory structure for files and folders.

Overview

A file system, depending on its type, provides one or more volumes to clients. The FSUnaryFileSystem by definition provides only one volume, while an FSFileSystem supports multiple volumes.

You implement a volume for your file system type by subclassing this class, and also conforming to the FSVolumeOperations and FSVolumePathConfOperations protocols. This protocol defines the minimum set of operations supported by a volume, such as mounting, activating, creating and removing items, and more.

Your volume can provide additional functionality by conforming to other volume operations protocols. These protocols add support for operations like open and close, read and write, extended attribute (Xattr) manipulation, and more.

Creating a volume

Accessing volume properties

See: https://developer.apple.com/documentation/FSKit/FSVolume

func FSVolumeFromID

func FSVolumeFromID(id objc.ID) FSVolume

FSVolumeFromID constructs a FSVolume from an objc.ID.

A directory structure for files and folders.

func NewFSVolume

func NewFSVolume() FSVolume

NewFSVolume creates a new FSVolume instance.

func NewVolumeWithVolumeIDVolumeName

func NewVolumeWithVolumeIDVolumeName(volumeID IFSVolumeIdentifier, volumeName IFSFileName) FSVolume

Creates a volume with the given identifier and name.

volumeID: An FSVolumeIdentifier to uniquely identify the volume. For a network file system that supports multiple authenticated users, disambiguate the users by using qualifying data in the identifier.

volumeName: A name for the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/init(volumeID:volumeName:)

func (FSVolume) Autorelease

func (v FSVolume) Autorelease() FSVolume

Autorelease adds the receiver to the current autorelease pool.

func (FSVolume) Init

func (v FSVolume) Init() FSVolume

Init initializes the instance.

func (FSVolume) InitWithVolumeIDVolumeName

func (v FSVolume) InitWithVolumeIDVolumeName(volumeID IFSVolumeIdentifier, volumeName IFSFileName) FSVolume

Creates a volume with the given identifier and name.

volumeID: An FSVolumeIdentifier to uniquely identify the volume. For a network file system that supports multiple authenticated users, disambiguate the users by using qualifying data in the identifier.

volumeName: A name for the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/init(volumeID:volumeName:)

func (FSVolume) Name

func (v FSVolume) Name() IFSFileName

The name of the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/name

func (FSVolume) SetName

func (v FSVolume) SetName(value IFSFileName)

func (FSVolume) VolumeID

func (v FSVolume) VolumeID() IFSVolumeIdentifier

An identifier that uniquely identifies the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/volumeID

type FSVolumeAccessCheckOperations

type FSVolumeAccessCheckOperations interface {
	objectivec.IObject

	// Checks whether the file system allows access to the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/checkAccess(to:requestedAccess:replyHandler:)
	CheckAccessToItemRequestedAccessReplyHandler(theItem IFSItem, access FSAccessMask, reply BoolErrorHandler)

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/isAccessCheckInhibited
	IsAccessCheckInhibited() bool

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/isAccessCheckInhibited
	AccessCheckInhibited() bool
	SetAccessCheckInhibited(value bool)
}

Methods and properties implemented by volumes that want to enforce access check operations.

See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations

type FSVolumeAccessCheckOperationsObject

type FSVolumeAccessCheckOperationsObject struct {
	objectivec.Object
}

FSVolumeAccessCheckOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeAccessCheckOperations protocol.

func FSVolumeAccessCheckOperationsObjectFromID

func FSVolumeAccessCheckOperationsObjectFromID(id objc.ID) FSVolumeAccessCheckOperationsObject

FSVolumeAccessCheckOperationsObjectFromID constructs a FSVolumeAccessCheckOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeAccessCheckOperationsObject) AccessCheckInhibited

func (o FSVolumeAccessCheckOperationsObject) AccessCheckInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/isAccessCheckInhibited

func (FSVolumeAccessCheckOperationsObject) BaseObject

func (FSVolumeAccessCheckOperationsObject) CheckAccessToItemRequestedAccessReplyHandler

func (o FSVolumeAccessCheckOperationsObject) CheckAccessToItemRequestedAccessReplyHandler(theItem IFSItem, access FSAccessMask, reply BoolErrorHandler)

Checks whether the file system allows access to the given item.

theItem: The item for which to check access.

access: A mask indicating a set of access types for which to check.

reply: A block or closure to indicate success or failure. If the access check succeeds, pass a Boolean value to indicate whether the file system grants access, followed by a `nil` error. If the access check fails, pass the relevant error as the second parameter; FSKit ignores the Boolean parameter in this case. For an `async` Swift implementation, there’s no reply handler; simply return the [Bool] or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/checkAccess(to:requestedAccess:replyHandler:)

func (FSVolumeAccessCheckOperationsObject) IsAccessCheckInhibited

func (o FSVolumeAccessCheckOperationsObject) IsAccessCheckInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

See: https://developer.apple.com/documentation/FSKit/FSVolume/AccessCheckOperations/isAccessCheckInhibited

func (FSVolumeAccessCheckOperationsObject) SetAccessCheckInhibited

func (o FSVolumeAccessCheckOperationsObject) SetAccessCheckInhibited(value bool)

type FSVolumeCaseFormat

type FSVolumeCaseFormat int

See: https://developer.apple.com/documentation/FSKit/FSVolume/CaseFormat

const (
	// FSVolumeCaseFormatInsensitive: The volume isn’t case sensitive.
	FSVolumeCaseFormatInsensitive FSVolumeCaseFormat = 1
	// FSVolumeCaseFormatInsensitiveCasePreserving: The volume isn’t case sensitive, but supports preserving the case of file and directory names.
	FSVolumeCaseFormatInsensitiveCasePreserving FSVolumeCaseFormat = 2
	// FSVolumeCaseFormatSensitive: The volume is case sensitive.
	FSVolumeCaseFormatSensitive FSVolumeCaseFormat = 0
)

func (FSVolumeCaseFormat) String

func (e FSVolumeCaseFormat) String() string

type FSVolumeClass

type FSVolumeClass struct {
	// contains filtered or unexported fields
}

func GetFSVolumeClass

func GetFSVolumeClass() FSVolumeClass

GetFSVolumeClass returns the class object for FSVolume.

func (FSVolumeClass) Alloc

func (fc FSVolumeClass) Alloc() FSVolume

Alloc allocates memory for a new instance of the class.

func (FSVolumeClass) Class

func (fc FSVolumeClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSVolumeErrorHandler

type FSVolumeErrorHandler = func(*FSVolume, error)

FSVolumeErrorHandler handles A block or closure that your implementation invokes when it finishes setting up or encounters an error. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [FSUnaryFileSystemOperations.LoadResourceOptionsReplyHandler]

type FSVolumeIdentifier

type FSVolumeIdentifier struct {
	FSEntityIdentifier
}

A type that identifies a volume.

Overview

For most volumes, the volume identifier is the UUID identifying the volume.

Network file systems may access the same underlying volume using different authentication credentials. To handle this situation, add qualifying data to identify the specific container, as discussed in the superclass, FSEntityIdentifier.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Identifier

func FSVolumeIdentifierFromID

func FSVolumeIdentifierFromID(id objc.ID) FSVolumeIdentifier

FSVolumeIdentifierFromID constructs a FSVolumeIdentifier from an objc.ID.

A type that identifies a volume.

func NewFSVolumeIdentifier

func NewFSVolumeIdentifier() FSVolumeIdentifier

NewFSVolumeIdentifier creates a new FSVolumeIdentifier instance.

func NewVolumeIdentifierWithUUID

func NewVolumeIdentifierWithUUID(uuid foundation.NSUUID) FSVolumeIdentifier

Creates an entity identifier with the given UUID.

uuid: The UUID to use for this identifier.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:)-9e20k

func NewVolumeIdentifierWithUUIDData

func NewVolumeIdentifierWithUUIDData(uuid foundation.NSUUID, qualifierData foundation.NSData) FSVolumeIdentifier

Creates an entity identifier with the given UUID and qualifier data.

uuid: The UUID to use for this identifier.

qualifierData: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:data:)-8dixs

func NewVolumeIdentifierWithUUIDQualifier

func NewVolumeIdentifierWithUUIDQualifier(uuid foundation.NSUUID, qualifier uint64) FSVolumeIdentifier

Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.

uuid: The UUID to use for this identifier.

qualifier: The data to distinguish entities that otherwise share the same UUID.

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier/init(uuid:qualifier:)-9ty70

func (FSVolumeIdentifier) Autorelease

func (v FSVolumeIdentifier) Autorelease() FSVolumeIdentifier

Autorelease adds the receiver to the current autorelease pool.

func (FSVolumeIdentifier) Init

Init initializes the instance.

type FSVolumeIdentifierClass

type FSVolumeIdentifierClass struct {
	// contains filtered or unexported fields
}

func GetFSVolumeIdentifierClass

func GetFSVolumeIdentifierClass() FSVolumeIdentifierClass

GetFSVolumeIdentifierClass returns the class object for FSVolumeIdentifier.

func (FSVolumeIdentifierClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSVolumeIdentifierClass) Class

func (fc FSVolumeIdentifierClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type FSVolumeItemDeactivation

type FSVolumeItemDeactivation interface {
	objectivec.IObject

	// Notifies the file system that the kernel is no longer making immediate use of the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivation/deactivateItem(_:replyHandler:)
	DeactivateItemReplyHandler(item IFSItem, reply ErrorHandler)

	// A property that tells FSKit to which types of items the deactivation applies, if any.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivation/itemDeactivationPolicy
	ItemDeactivationPolicy() FSItemDeactivationOptions
}

Methods and properties implemented by volumes that support deactivating items.

See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivation

type FSVolumeItemDeactivationObject

type FSVolumeItemDeactivationObject struct {
	objectivec.Object
}

FSVolumeItemDeactivationObject wraps an existing Objective-C object that conforms to the FSVolumeItemDeactivation protocol.

func FSVolumeItemDeactivationObjectFromID

func FSVolumeItemDeactivationObjectFromID(id objc.ID) FSVolumeItemDeactivationObject

FSVolumeItemDeactivationObjectFromID constructs a FSVolumeItemDeactivationObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeItemDeactivationObject) BaseObject

func (FSVolumeItemDeactivationObject) DeactivateItemReplyHandler

func (o FSVolumeItemDeactivationObject) DeactivateItemReplyHandler(item IFSItem, reply ErrorHandler)

Notifies the file system that the kernel is no longer making immediate use of the given item.

item: The item to deactivate.

reply: A block or closure to indicate success or failure. If deactivation fails, pass an error as the one parameter to the reply handler. If deactivation succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

This method gives a file system a chance to release resources associated wtih an item. However, this method prescribes no specific action; it’s acceptable to defer all reclamation until [ReclaimItemReplyHandler]. This method is the equivalent of VFS’s `VNOP_INACTIVE`.

FSKit restricts calls to this method based on the current value of [ItemDeactivationPolicy].

See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivation/deactivateItem(_:replyHandler:)

func (FSVolumeItemDeactivationObject) ItemDeactivationPolicy

func (o FSVolumeItemDeactivationObject) ItemDeactivationPolicy() FSItemDeactivationOptions

A property that tells FSKit to which types of items the deactivation applies, if any.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/ItemDeactivation/itemDeactivationPolicy

type FSVolumeKernelOffloadedIOOperations

type FSVolumeKernelOffloadedIOOperations interface {
	objectivec.IObject

	// Maps a file’s disk space into extents, allowing the kernel to perform I/O with that space.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/blockmapFile(_:offset:length:flags:operationID:packer:replyHandler:)
	BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler(file IFSItem, offset int64, length uintptr, flags FSBlockmapFlags, operationID FSOperationID, packer IFSExtentPacker, reply ErrorHandler)

	// Completes an I/O operation for a given file.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/completeIO(for:offset:length:status:flags:operationID:replyHandler:)
	CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler(file IFSItem, offset int64, length uintptr, status foundation.NSError, flags FSCompleteIOFlags, operationID FSOperationID, reply ErrorHandler)

	// Creates a new file item and map its disk space.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/createFile(name:in:attributes:packer:replyHandler:)
	CreateFileNamedInDirectoryAttributesPackerReplyHandler(name IFSFileName, directory IFSItem, attributes IFSItemSetAttributesRequest, packer IFSExtentPacker, reply FSItemFSFileNameErrorHandler)

	// Looks up an item within a directory and maps its disk space.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/lookupItem(name:in:packer:replyHandler:)
	LookupItemNamedInDirectoryPackerReplyHandler(name IFSFileName, directory IFSItem, packer IFSExtentPacker, reply FSItemFSFileNameErrorHandler)
}

Methods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations

type FSVolumeKernelOffloadedIOOperationsObject

type FSVolumeKernelOffloadedIOOperationsObject struct {
	objectivec.Object
}

FSVolumeKernelOffloadedIOOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeKernelOffloadedIOOperations protocol.

func FSVolumeKernelOffloadedIOOperationsObjectFromID

func FSVolumeKernelOffloadedIOOperationsObjectFromID(id objc.ID) FSVolumeKernelOffloadedIOOperationsObject

FSVolumeKernelOffloadedIOOperationsObjectFromID constructs a FSVolumeKernelOffloadedIOOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeKernelOffloadedIOOperationsObject) BaseObject

func (FSVolumeKernelOffloadedIOOperationsObject) BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler

func (o FSVolumeKernelOffloadedIOOperationsObject) BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler(file IFSItem, offset int64, length uintptr, flags FSBlockmapFlags, operationID FSOperationID, packer IFSExtentPacker, reply ErrorHandler)

Maps a file’s disk space into extents, allowing the kernel to perform I/O with that space.

file: The file for which to map disk space.

offset: The starting logical offset of the range to be mapped (in bytes).

length: The length of the range to be mapped (in bytes).

flags: Flags that affect the behavior of the blockmap operation.

operationID: A unique identifier of the blockmap call. Any value other than `0` (Objective-C) or unspecified (Swift) indicates the beginning of an I/O operation. A value of `0` or unspecified indicates the kernel maps the file without performing I/O. In this case, FSKit doesn’t perform a corresponding call to [CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler].

packer: An extent packer you use to pack the requested range of the file’s allocated disk space. FSKit sends all of the packed extents to the kernel when it invokes `reply`.

reply: A block or closure to indicate success or failure. If mapping fails, pass an error as the one parameter to the reply handler. If mapping succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

FSKit calls this method when the kernel needs to get a mapping of logical-to-physical offsets of the file’s data. This call may occur as part of an I/O operation on the file, or just to get the mapping as part of a `fcntl(F_LOG2PHYS)` system call. In the case of an I/O operation on the file, `operationID` has a nonzero value; a future call to [CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler] uses the same `operationID` to indicate which operation it completes. In the case of a `fcntl(F_LOG2PHYS)` system call, the `operationID` parameter is `0` (Objective-C) or unspecified (Swift). In both cases the kernel retains the mapping, and it may perform I/O to this range (or a part of it) at any time.

If satisfying a blockmap request requires more extents than `packer` can handle, FSKit makes additional calls to this method with the same operation ID to collect the remainder.

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/blockmapFile(_:offset:length:flags:operationID:packer:replyHandler:)

func (FSVolumeKernelOffloadedIOOperationsObject) CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler

func (o FSVolumeKernelOffloadedIOOperationsObject) CompleteIOForFileOffsetLengthStatusFlagsOperationIDReplyHandler(file IFSItem, offset int64, length uintptr, status foundation.NSError, flags FSCompleteIOFlags, operationID FSOperationID, reply ErrorHandler)

Completes an I/O operation for a given file.

file: The file for which the I/O operation completed.

offset: The starting logical offset at which I/O started.

length: The length of the I/O range (in bytes).

status: Any error that occurred during the operation. If no error occurred, this parameter is `nil`.

flags: Flags that affect the behavior of the complete I/O operation.

operationID: A unique identifier of the blockmap call. Any value other than `0` (Objective-C) or unspecified (Swift) corresponds to a previous call to [BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler] with the same `operationID`.

reply: A block or closure to indicate success or failure. If completing I/O fails, pass an error as the one parameter to the reply handler. If completing I/O succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

Implement this method by updating a file’s metadata, such as its size and modification time.

FSKit may call this method without an earlier call to [BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler]. In this case, the `operationID` is `0` (Objective-C) or unspecified (Swift).

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/completeIO(for:offset:length:status:flags:operationID:replyHandler:)

func (FSVolumeKernelOffloadedIOOperationsObject) CreateFileNamedInDirectoryAttributesPackerReplyHandler

func (o FSVolumeKernelOffloadedIOOperationsObject) CreateFileNamedInDirectoryAttributesPackerReplyHandler(name IFSFileName, directory IFSItem, attributes IFSItemSetAttributesRequest, packer IFSExtentPacker, reply FSItemFSFileNameErrorHandler)

Creates a new file item and map its disk space.

name: The new file’s name.

directory: The directory in which to create the file.

attributes: Attributes to apply to the new file.

packer: An extent packer you use to pack the file’s allocated disk space.

reply: A block or closure to indicate success or failure. If creation succeeds, pass the newly created FSItem and its FSFileName, along with a `nil` error. If creation fails, pass the relevant error as the third parameter; FSKit ignores any FSItem or FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; instead, return a tuple of the FSItem and its FSFileName or throw an error.

Discussion

This method allows the module to opportunistically supply extents, avoiding future calls to [BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler]. Only perform this technique opportunistically. In particular, don’t perform additional I/O to fetch extent data.

Packing extents in this method requires that `attributes` defines a size greater than 0.

An implementation that doesn’t supply the extents can ignore the packer and call the corresponding method in the FSVolumeOperations protocol, [CreateItemNamedTypeInDirectoryAttributesReplyHandler].

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/createFile(name:in:attributes:packer:replyHandler:)

func (FSVolumeKernelOffloadedIOOperationsObject) LookupItemNamedInDirectoryPackerReplyHandler

func (o FSVolumeKernelOffloadedIOOperationsObject) LookupItemNamedInDirectoryPackerReplyHandler(name IFSFileName, directory IFSItem, packer IFSExtentPacker, reply FSItemFSFileNameErrorHandler)

Looks up an item within a directory and maps its disk space.

name: The name of the file to look up.

directory: The directory in which to look up the file.

packer: An extent packer you use to pack the file’s allocated disk space.

reply: A block or closure to indicate success or failure. If lookup succeeds, pass the found FSItem and its FSFileName, along with a `nil` error. If lookup fails, pass the relevant error as the third parameter; FSKit ignores any FSItem or FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; instead, return a tuple of the FSItem and its FSFileName or throw an error.

Discussion

This method allows the module to opportunistically supply extents, avoiding future calls to [BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler]. Only perform this technique opportunistically. In particular, don’t perform additional I/O to fetch extent data.

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/lookupItem(name:in:packer:replyHandler:)

func (FSVolumeKernelOffloadedIOOperationsObject) PreallocateSpaceForFileAtOffsetLengthFlagsPackerReplyHandler

func (o FSVolumeKernelOffloadedIOOperationsObject) PreallocateSpaceForFileAtOffsetLengthFlagsPackerReplyHandler(file IFSItem, offset int64, length uintptr, flags FSPreallocateFlags, packer IFSExtentPacker, reply size_tErrorHandler)

Preallocates and maps disk space for the given file.

file: The item for which to preallocate space.

offset: The offset from which to allocate.

length: The length of the space in bytes.

flags: Flags that affect the preallocation behavior.

packer: An extent packer you use to pack the file’s preallocated disk space.

reply: A block or closure to indicate success or failure. If preallocation succeeds, pass the amount of bytes allocated and a nil error. If preallocation fails, pass the relevant error as the second parameter; FSKit ignores any byte count in this case. For an `async` Swift implementation, there’s no reply handler; simply return the allocated byte count or throw an error.

Discussion

This method allows the module to opportunistically supply extents, avoiding future calls to [BlockmapFileOffsetLengthFlagsOperationIDPackerReplyHandler].

See: https://developer.apple.com/documentation/FSKit/FSVolumeKernelOffloadedIOOperations/preallocateSpace(for:at:length:flags:packer:replyHandler:)

type FSVolumeOpenCloseOperations

type FSVolumeOpenCloseOperations interface {
	objectivec.IObject

	// Opens a file for access.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/openItem(_:modes:replyHandler:)
	OpenItemWithModesReplyHandler(item IFSItem, modes FSVolumeOpenModes, reply ErrorHandler)

	// Closes a file from further access.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/closeItem(_:modes:replyHandler:)
	CloseItemKeepingModesReplyHandler(item IFSItem, modes FSVolumeOpenModes, reply ErrorHandler)

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/isOpenCloseInhibited
	IsOpenCloseInhibited() bool

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/isOpenCloseInhibited
	OpenCloseInhibited() bool
	SetOpenCloseInhibited(value bool)
}

Methods and properties implemented by volumes that want to receive open and close calls for each item.

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations

type FSVolumeOpenCloseOperationsObject

type FSVolumeOpenCloseOperationsObject struct {
	objectivec.Object
}

FSVolumeOpenCloseOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeOpenCloseOperations protocol.

func FSVolumeOpenCloseOperationsObjectFromID

func FSVolumeOpenCloseOperationsObjectFromID(id objc.ID) FSVolumeOpenCloseOperationsObject

FSVolumeOpenCloseOperationsObjectFromID constructs a FSVolumeOpenCloseOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeOpenCloseOperationsObject) BaseObject

func (FSVolumeOpenCloseOperationsObject) CloseItemKeepingModesReplyHandler

func (o FSVolumeOpenCloseOperationsObject) CloseItemKeepingModesReplyHandler(item IFSItem, modes FSVolumeOpenModes, reply ErrorHandler)

Closes a file from further access.

item: The item to close.

modes: The set of mode flags to keep after this close.

reply: A block or closure to indicate success or failure. If closing fails, pass an error as the one parameter to the reply handler. If closing succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/closeItem(_:modes:replyHandler:)

func (FSVolumeOpenCloseOperationsObject) IsOpenCloseInhibited

func (o FSVolumeOpenCloseOperationsObject) IsOpenCloseInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/isOpenCloseInhibited

func (FSVolumeOpenCloseOperationsObject) OpenCloseInhibited

func (o FSVolumeOpenCloseOperationsObject) OpenCloseInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/isOpenCloseInhibited

func (FSVolumeOpenCloseOperationsObject) OpenItemWithModesReplyHandler

func (o FSVolumeOpenCloseOperationsObject) OpenItemWithModesReplyHandler(item IFSItem, modes FSVolumeOpenModes, reply ErrorHandler)

Opens a file for access.

item: The item to open.

modes: The set of mode flags to open the item with.

reply: A block or closure to indicate success or failure. If opening fails, pass an error as the one parameter to the reply handler. If opening succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenCloseOperations/openItem(_:modes:replyHandler:)

func (FSVolumeOpenCloseOperationsObject) SetOpenCloseInhibited

func (o FSVolumeOpenCloseOperationsObject) SetOpenCloseInhibited(value bool)

type FSVolumeOpenModes

type FSVolumeOpenModes uint

See: https://developer.apple.com/documentation/FSKit/FSVolume/OpenModes

const (
	// FSVolumeOpenModesRead: The read mode.
	FSVolumeOpenModesRead FSVolumeOpenModes = 0x1
	// FSVolumeOpenModesWrite: The write mode.
	FSVolumeOpenModesWrite FSVolumeOpenModes = 0x2
)

func (FSVolumeOpenModes) String

func (e FSVolumeOpenModes) String() string

type FSVolumeOperations

type FSVolumeOperations interface {
	objectivec.IObject

	// Activates the volume using the specified options.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/activate(options:replyHandler:)
	ActivateWithOptionsReplyHandler(options IFSTaskOptions, reply FSItemErrorHandler)

	// Tears down a previously initialized volume instance.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/deactivate(options:replyHandler:)
	DeactivateWithOptionsReplyHandler(options FSDeactivateOptions, reply ErrorHandler)

	// Mounts this volume, using the specified options.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/mount(options:replyHandler:)
	MountWithOptionsReplyHandler(options IFSTaskOptions, reply ErrorHandler)

	// Unmounts this volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/unmount(replyHandler:)
	UnmountWithReplyHandler(reply VoidHandler)

	// Creates a new file or directory item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createItem(named:type:inDirectory:attributes:replyHandler:)
	CreateItemNamedTypeInDirectoryAttributesReplyHandler(name IFSFileName, type_ FSItemType, directory IFSItem, newAttributes IFSItemSetAttributesRequest, reply FSItemFSFileNameErrorHandler)

	// Looks up an item within a directory.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/lookupItem(named:inDirectory:replyHandler:)
	LookupItemNamedInDirectoryReplyHandler(name IFSFileName, directory IFSItem, reply FSItemFSFileNameErrorHandler)

	// Removes an existing item from a given directory.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/removeItem(_:named:fromDirectory:replyHandler:)
	RemoveItemNamedFromDirectoryReplyHandler(item IFSItem, name IFSFileName, directory IFSItem, reply ErrorHandler)

	// Renames an item from one path in the file system to another.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/renameItem(_:inDirectory:named:to:inDirectory:overItem:replyHandler:)
	RenameItemInDirectoryNamedToNewNameInDirectoryOverItemReplyHandler(item IFSItem, sourceDirectory IFSItem, sourceName IFSFileName, destinationName IFSFileName, destinationDirectory IFSItem, overItem IFSItem, reply FSFileNameErrorHandler)

	// Reclaims an item, releasing any resources allocated for the item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/reclaimItem(_:replyHandler:)
	ReclaimItemReplyHandler(item IFSItem, reply ErrorHandler)

	// Creates a new hard link.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createLink(to:named:inDirectory:replyHandler:)
	CreateLinkToItemNamedInDirectoryReplyHandler(item IFSItem, name IFSFileName, directory IFSItem, reply FSFileNameErrorHandler)

	// Creates a new symbolic link.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createSymbolicLink(named:inDirectory:attributes:linkContents:replyHandler:)
	CreateSymbolicLinkNamedInDirectoryAttributesLinkContentsReplyHandler(name IFSFileName, directory IFSItem, newAttributes IFSItemSetAttributesRequest, contents IFSFileName, reply FSItemFSFileNameErrorHandler)

	// Reads a symbolic link.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/readSymbolicLink(_:replyHandler:)
	ReadSymbolicLinkReplyHandler(item IFSItem, reply FSFileNameErrorHandler)

	// Fetches attributes for the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/getAttributes(_:of:replyHandler:)
	GetAttributesOfItemReplyHandler(desiredAttributes IFSItemGetAttributesRequest, item IFSItem, reply FSItemAttributesErrorHandler)

	// Sets the given attributes on an item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/setAttributes(_:on:replyHandler:)
	SetAttributesOnItemReplyHandler(newAttributes IFSItemSetAttributesRequest, item IFSItem, reply FSItemAttributesErrorHandler)

	// Enumerates the contents of the given directory.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/enumerateDirectory(_:startingAt:verifier:attributes:packer:replyHandler:)
	EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler(directory IFSItem, cookie FSDirectoryCookie, verifier FSDirectoryVerifier, attributes IFSItemGetAttributesRequest, packer IFSDirectoryEntryPacker, reply FSDirectoryVerifierErrorHandler)

	// Synchronizes the volume with its underlying resource.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/synchronize(flags:replyHandler:)
	SynchronizeWithFlagsReplyHandler(flags FSSyncFlags, reply ErrorHandler)

	// A property that provides the supported capabilities of the volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/supportedVolumeCapabilities
	SupportedVolumeCapabilities() IFSVolumeSupportedCapabilities

	// A property that provides up-to-date statistics of the volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/volumeStatistics
	VolumeStatistics() IFSStatFSResult

	// A property that allows the file system to request for specific mount options from FSKit.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/requestedMountOptions
	RequestedMountOptions() FSMountOptions
	SetRequestedMountOptions(value FSMountOptions)

	// A property that allows the file system to use open-unlink emulation.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/enableOpenUnlinkEmulation
	EnableOpenUnlinkEmulation() bool
	SetEnableOpenUnlinkEmulation(value bool)
}

Methods that all volumes implement to provide required capabilities.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations

type FSVolumeOperationsObject

type FSVolumeOperationsObject struct {
	objectivec.Object
}

FSVolumeOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeOperations protocol.

func FSVolumeOperationsObjectFromID

func FSVolumeOperationsObjectFromID(id objc.ID) FSVolumeOperationsObject

FSVolumeOperationsObjectFromID constructs a FSVolumeOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeOperationsObject) ActivateWithOptionsReplyHandler

func (o FSVolumeOperationsObject) ActivateWithOptionsReplyHandler(options IFSTaskOptions, reply FSItemErrorHandler)

Activates the volume using the specified options.

options: Options to apply to the activation. These can include security-scoped file paths. There are no defined options currently.

reply: A block or closure to indicate success or failure. If activation succeeds, pass the root FSItem and a `nil` error. If activation fails, pass the relevant error as the second parameter; FSKit ignores any FSItem in this case. In Swift, `reply` takes only the FSItem as the parameter; you signal any error with a `throw`. For an `async` Swift implementation, there’s no reply handler; simply return the FSItem or throw an error.

Discussion

When FSKit calls this method, allocate any in-memory state required to represent the file system. Also allocate an FSItem for the root directory of the file system, and pass it to the reply block. FSKit caches this root item for the lifetime of the volume, and uses it as a starting point for all file look-ups.

Volume activation occurs prior to any call to mount the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/activate(options:replyHandler:)

func (FSVolumeOperationsObject) BaseObject

func (FSVolumeOperationsObject) CreateItemNamedTypeInDirectoryAttributesReplyHandler

func (o FSVolumeOperationsObject) CreateItemNamedTypeInDirectoryAttributesReplyHandler(name IFSFileName, type_ FSItemType, directory IFSItem, newAttributes IFSItemSetAttributesRequest, reply FSItemFSFileNameErrorHandler)

Creates a new file or directory item.

name: The new item’s name.

type: The new item’s type. Valid values are FSItemTypeFile or FSItemTypeDirectory.

directory: The directory in which to create the item.

newAttributes: Attributes to apply to the new item.

reply: A block or closure to indicate success or failure. If creation succeeds, pass the newly-created FSItem and its FSFileName, along with a `nil` error. If creation fails, pass the relevant error as the third parameter; FSKit ignores any FSItem or FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; simply return a tuple of the FSItem and its FSFileName or throw an error.

Discussion

If an item named `name` already exists in the directory indicated by `directory`, complete the request with an error with a domain of NSPOSIXErrorDomain and a code of [EEXIST].

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createItem(named:type:inDirectory:attributes:replyHandler:)

func (FSVolumeOperationsObject) CreateLinkToItemNamedInDirectoryReplyHandler

func (o FSVolumeOperationsObject) CreateLinkToItemNamedInDirectoryReplyHandler(item IFSItem, name IFSFileName, directory IFSItem, reply FSFileNameErrorHandler)

Creates a new hard link.

item: The existing item to which to link.

name: The name for the new link.

directory: The directory in which to create the link.

reply: A block or closure to indicate success or failure. If creation succeeds, pass an FSFileName of the newly-created link and a `nil` error. If creation fails, pass the relevant error as the second parameter; FSKit ignores any FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSFileName or throw an error.

Discussion

If creating the link fails, complete the request with an error with a domain of NSPOSIXErrorDomain and the following error codes:

- [EEXIST] if there’s already an item named `name` in the directory. - [EMLINK] if creating the link would exceed the maximum number of hard links supported on `item`. - [ENOTSUP] if the file system doesn’t support creating hard links to the type of file system object that `item` represents.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createLink(to:named:inDirectory:replyHandler:)

func (FSVolumeOperationsObject) CreateSymbolicLinkNamedInDirectoryAttributesLinkContentsReplyHandler

func (o FSVolumeOperationsObject) CreateSymbolicLinkNamedInDirectoryAttributesLinkContentsReplyHandler(name IFSFileName, directory IFSItem, newAttributes IFSItemSetAttributesRequest, contents IFSFileName, reply FSItemFSFileNameErrorHandler)

Creates a new symbolic link.

name: The new item’s name.

directory: The directory in which to create the item.

newAttributes: Attributes to apply to the new item.

contents: The contents of the new symbolic link.

reply: A block or closure to indicate success or failure. If creation succeeds, pass the newly-created FSItem and a `nil` error. If creation fails, pass the relevant error as the second parameter; FSKit ignores any FSItem in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSItem or throw an error.

Discussion

If an item named `name` already exists in the directory indicated by `directory`, complete the request with an error with a domain of NSPOSIXErrorDomain and a code of [EEXIST].

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/createSymbolicLink(named:inDirectory:attributes:linkContents:replyHandler:)

func (FSVolumeOperationsObject) DeactivateWithOptionsReplyHandler

func (o FSVolumeOperationsObject) DeactivateWithOptionsReplyHandler(options FSDeactivateOptions, reply ErrorHandler)

Tears down a previously initialized volume instance.

options: Options to apply to the deactivation.

reply: A block or closure to indicate success or failure. If activation fails, pass an error as the one parameter to the reply handler. If activation succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

Set up your implementation to release any resources allocated for the volume instance. By the time you receive this callback, FSKit has already performed a reclaim call to release all other file nodes associated with this file system instance.

Avoid performing any I/O in this method. Prior to calling this method, FSKit has already issued a sync call to perform any cleanup-related I/O.

FSKit unmounts any mounted volume with a call to [UnmountWithReplyHandler] prior to the deactivate callback.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/deactivate(options:replyHandler:)

func (FSVolumeOperationsObject) EnableOpenUnlinkEmulation

func (o FSVolumeOperationsObject) EnableOpenUnlinkEmulation() bool

A property that allows the file system to use open-unlink emulation.

Discussion

functionality refers to a file system’s ability to support an open file being fully unlinked from the file system namespace. If a file system doesn’t support this functionality, FSKit can emulate it instead; this is called “open-unlink emulation”.

Implement this property to return `true` (Swift) or [YES] (Objective-C) to allow FSKit to perform open-unlink emulation. If you don’t implement this property at all, FSKit doesn’t perform open-unlink emulation for this volume.

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/enableOpenUnlinkEmulation

func (FSVolumeOperationsObject) EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler

func (o FSVolumeOperationsObject) EnumerateDirectoryStartingAtCookieVerifierProvidingAttributesUsingPackerReplyHandler(directory IFSItem, cookie FSDirectoryCookie, verifier FSDirectoryVerifier, attributes IFSItemGetAttributesRequest, packer IFSDirectoryEntryPacker, reply FSDirectoryVerifierErrorHandler)

Enumerates the contents of the given directory.

directory: The item to enumerate. FSKit guarantees this item is of type FSItemTypeDirectory.

cookie: A value that indicates the location within the directory from which to enumerate. Your implementation defines the semantics of the cookie values; they’re opaque to FSKit. The first call to the enumerate method passes initial for this parameter. Subsequent calls pass whatever cookie value you previously passed to the packer’s `nextCookie` parmeter.

verifier: A tool to detect whether the directory contents changed since the last call to `enumerateDirectory`. Your implementation defines the semantics of the verifier values; they’re opaque to FSKit. The first call to the enumerate method passes initial for this parameter. Subsequent calls pass whatever cookie value you previously passed to the packer’s `currentVerifier` parmeter.

attributes: The desired attributes to provide, or `nil` if the caller doesn’t require attributes.

packer: An object that your implementation uses to enumerate directory items, packing one item per callback to `enumerateDirectory`.

reply: A block or closure to indicate success or failure. If enumeration succeeds, pass the current verifier and a `nil` error. If enumeration fails, pass the relevant error as the second parameter; FSKit ignores any verifier in this case. For an `async` Swift implementation, there’s no reply handler; simply return the current verifier or throw an error.

Discussion

This method uses the FSDirectoryEntryPacker.PackEntryWithNameItemTypeItemIDNextCookieAttributes method of the `packer` parameter to deliver the enumerated items to the caller. The general flow of an enumeration implementation follows these steps:

- Enumeration starts with a call to `enumerateDirectory` using the initial next-cookie and verifier values initial and initial, respectively. - The implementation uses `packer` to pack the initial set of directory entries. Packing also sets a `nextCookie` to use on the next call. - The implementation replies with a new verifier value, a nonzero value that reflects the directory’s current version. - On the next call the implementation packs the next set of entries, starting with the item indicated by `cookie`. If `cookie` doesn’t resolve to a valid directory entry, complete the request with an error of domain NSPOSIXErrorDomain and code FSErrorInvalidDirectoryCookie.

When packing, make sure to use acceptable directory entry names and unambiguous input to all file operations that take names without additional normalization, such as`lookupName`.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/enumerateDirectory(_:startingAt:verifier:attributes:packer:replyHandler:)

func (FSVolumeOperationsObject) GetAttributesOfItemReplyHandler

func (o FSVolumeOperationsObject) GetAttributesOfItemReplyHandler(desiredAttributes IFSItemGetAttributesRequest, item IFSItem, reply FSItemAttributesErrorHandler)

Fetches attributes for the given item.

desiredAttributes: A requested set of attributes to get. The implementation inspects the request’s FSItemGetAttributesRequest.WantedAttributes to determine which attributes to populate.

item: The item to get attributes for.

reply: A block or closure to indicate success or failure. If getting attributes succeeds, pass an FSItemAttributes with the requested attributes populated and a `nil` error. If getting attributes fails, pass the relevant error as the second parameter; FSKit ignores any FSItemAttributes in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSItemAttributes or throw an error.

Discussion

For file systems that don’t support hard links, set FSItemAttributes.LinkCount to `1` for regular files and symbolic links.

If the item’s `bsdFlags` contain the `UF_COMPRESSED` flag, your file system returns the uncompressed size of the file.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/getAttributes(_:of:replyHandler:)

func (FSVolumeOperationsObject) LookupItemNamedInDirectoryReplyHandler

func (o FSVolumeOperationsObject) LookupItemNamedInDirectoryReplyHandler(name IFSFileName, directory IFSItem, reply FSItemFSFileNameErrorHandler)

Looks up an item within a directory.

name: The name of the item to look up.

directory: The directory in which to look up the item.

reply: A block or closure to indicate success or failure. If lookup succeeds, pass the found FSItem and its FSFileName (as saved within the file system), along with a `nil` error. If lookup fails, pass the relevant error as the third parameter; any FSItem or FSFileName are ignored in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSItem and FSFileName as a tuple or throw an error.

Discussion

If no item matching `name` exists in the directory indicated by `directory`, complete the request with an error with a domain of NSPOSIXErrorDomain and a code of [ENOENT].

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/lookupItem(named:inDirectory:replyHandler:)

func (FSVolumeOperationsObject) MountWithOptionsReplyHandler

func (o FSVolumeOperationsObject) MountWithOptionsReplyHandler(options IFSTaskOptions, reply ErrorHandler)

Mounts this volume, using the specified options.

options: Options to apply to the mount. These can include security-scoped file paths. There are no defined options currently.

reply: A block or closure to indicate success or failure. If mounting fails, pass an error as the one parameter to the reply handler. If mounting succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply return normally.

Discussion

FSKit calls this method as a signal that some process is trying to mount this volume. Your file system receives a call to [ActivateWithOptionsReplyHandler] prior to receiving any mount calls.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/mount(options:replyHandler:)

func (FSVolumeOperationsObject) ReadSymbolicLinkReplyHandler

func (o FSVolumeOperationsObject) ReadSymbolicLinkReplyHandler(item IFSItem, reply FSFileNameErrorHandler)

Reads a symbolic link.

item: The symbolic link to read from. FSKit guarantees this item is of type FSItemTypeSymlink.

reply: A block or closure to indicate success or failure. If reading succeeds, pass the link’s contents as an FSFileName and a `nil` error. If reading fails, pass the relevant error as the second parameter; FSKit ignores any FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSFileName or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/readSymbolicLink(_:replyHandler:)

func (FSVolumeOperationsObject) ReclaimItemReplyHandler

func (o FSVolumeOperationsObject) ReclaimItemReplyHandler(item IFSItem, reply ErrorHandler)

Reclaims an item, releasing any resources allocated for the item.

item: The item to reclaim.

reply: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

FSKit guarantees that for every FSItem returned by the volume, a corresponding reclaim operation occurs after the upper layers no longer reference that item.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/reclaimItem(_:replyHandler:)

func (FSVolumeOperationsObject) RemoveItemNamedFromDirectoryReplyHandler

func (o FSVolumeOperationsObject) RemoveItemNamedFromDirectoryReplyHandler(item IFSItem, name IFSFileName, directory IFSItem, reply ErrorHandler)

Removes an existing item from a given directory.

item: The item to remove.

name: The name of the item to remove.

directory: The directory from which to remove the item.

reply: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

Don’t actually remove the item object itself in your implementation; instead, only remove the given item name from the given directory. Remove and deallocate the item in [ReclaimItemReplyHandler].

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/removeItem(_:named:fromDirectory:replyHandler:)

func (FSVolumeOperationsObject) RenameItemInDirectoryNamedToNewNameInDirectoryOverItemReplyHandler

func (o FSVolumeOperationsObject) RenameItemInDirectoryNamedToNewNameInDirectoryOverItemReplyHandler(item IFSItem, sourceDirectory IFSItem, sourceName IFSFileName, destinationName IFSFileName, destinationDirectory IFSItem, overItem IFSItem, reply FSFileNameErrorHandler)

Renames an item from one path in the file system to another.

item: The file system object being renamed.

sourceDirectory: The directory that currently contains the item to rename.

sourceName: The name of the item within the source directory.

destinationName: The new name of the item as it appears in `destinationDirectory`.

destinationDirectory: The directory to contain the renamed object, which may be the same as `sourceDirectory`.

overItem: The file system object if the destination exists, as discovered in a prior lookup. If this parameter is non-`nil`, mark `overItem` as deleted, so the file system can free its allocated space on the next call to [ReclaimItemReplyHandler]. After doing so, ensure the operation finishes without errors.

reply: A block or closure to indicate success or failure. If renaming succeeds, pass the FSFileName as it exists within `destinationDirectory` and a `nil` error. If renaming fails, pass the relevant error as the second parameter; FSKit ignores any FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSFileName or throw an error.

Discussion

Implement renaming along the lines of this algorithm:

- If `item` is a file: - - If the destination file exists: - - Remove the destination file. - If the source and destination directories are the same: - - Rewrite the name in the existing directory. - Else: - - Write the new entry in the destination directory. - Clear the old directory entry. - If `item` is a directory: - - If the destination directory exists: - - If the destination directory isn’t empty: - - Fail the operation with an error of NSPOSIXErrorDomain and a code of [ENOTEMPTY]. - Else: - - Remove the destination directory. - If the source and destination directories are the same: - - Rewrite the name in the existing directory. - Else: - - If the destination is a child of the source directory: - - Fail the operation with an error. - Else: - - Write the new entry in the destination directory. - Update `"."` and `".."` in the moved directory. - Clear the old directory entry.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/renameItem(_:inDirectory:named:to:inDirectory:overItem:replyHandler:)

func (FSVolumeOperationsObject) RequestedMountOptions

func (o FSVolumeOperationsObject) RequestedMountOptions() FSMountOptions

A property that allows the file system to request for specific mount options from FSKit.

Discussion

FSKit reads this value after the volume replies to the [MountWithOptionsReplyHandler] call. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/requestedMountOptions

func (FSVolumeOperationsObject) SetAttributesOnItemReplyHandler

func (o FSVolumeOperationsObject) SetAttributesOnItemReplyHandler(newAttributes IFSItemSetAttributesRequest, item IFSItem, reply FSItemAttributesErrorHandler)

Sets the given attributes on an item.

newAttributes: A request containing the attributes to set.

item: The item on which to set the attributes.

reply: A block or closure to indicate success or failure. If setting attributes succeeds, pass an FSItemAttributes with the item’s updated attributes and a `nil` error. If setting attributes fails, pass the relevant error as the second parameter; FSKit ignores any FSItemAttributes in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSItemAttributes or throw an error.

Discussion

Several attributes are considered “read-only”, and an attempt to set these attributes results in an error with the code [EINVAL].

A request may set FSItemAttributes.Size beyond the end of the file. If the underlying file system doesn’t support sparse files, allocate space to fill the new file size. Either fill this space with zeroes, or configure it to read as zeroes.

If a request sets the file size below the current end-of-file, truncate the file and return any unused space to the file system as free space.

Ignore attempts to set the size of directories or symbolic links; don’t produce an error.

If the caller attepts to sest an attribute not supported by the on-disk file system format, don’t produce an error. The upper layers of the framework will detect this situation.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/setAttributes(_:on:replyHandler:)

func (FSVolumeOperationsObject) SetEnableOpenUnlinkEmulation

func (o FSVolumeOperationsObject) SetEnableOpenUnlinkEmulation(value bool)

func (FSVolumeOperationsObject) SetRequestedMountOptions

func (o FSVolumeOperationsObject) SetRequestedMountOptions(value FSMountOptions)

func (FSVolumeOperationsObject) SupportedVolumeCapabilities

func (o FSVolumeOperationsObject) SupportedVolumeCapabilities() IFSVolumeSupportedCapabilities

A property that provides the supported capabilities of the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/supportedVolumeCapabilities

func (FSVolumeOperationsObject) SynchronizeWithFlagsReplyHandler

func (o FSVolumeOperationsObject) SynchronizeWithFlagsReplyHandler(flags FSSyncFlags, reply ErrorHandler)

Synchronizes the volume with its underlying resource.

flags: Timing flags, as defined in `mount.H().` These flags let the file system know whether to run the operation in a blocking or nonblocking fashion.

reply: A block or closure to indicate success or failure. If synchronization fails, pass an error as the one parameter to the reply handler. If synchronization succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

Discussion

After calling this method, FSKit assumes that the volume has sent all pending I/O or metadata to its resource.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/synchronize(flags:replyHandler:)

func (FSVolumeOperationsObject) UnmountWithReplyHandler

func (o FSVolumeOperationsObject) UnmountWithReplyHandler(reply VoidHandler)

Unmounts this volume.

reply: A block or closure to indicate success or failure. If unmounting fails, pass an error as the one parameter to the reply handler. If unmounting succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply return normally.

Discussion

Clear and flush all cached state in your implementation of this method.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/unmount(replyHandler:)

func (FSVolumeOperationsObject) VolumeStatistics

func (o FSVolumeOperationsObject) VolumeStatistics() IFSStatFSResult

A property that provides up-to-date statistics of the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Operations/volumeStatistics

type FSVolumePathConfOperations

type FSVolumePathConfOperations interface {
	objectivec.IObject

	// A property that represents the maximum number of hard links to the object.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumLinkCount
	MaximumLinkCount() int

	// A property that represents the maximum length of a component of a filename.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumNameLength
	MaximumNameLength() int

	// A Boolean property that indicates whether the volume restricts ownership changes based on authorization.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/restrictsOwnershipChanges
	RestrictsOwnershipChanges() bool

	// A property that indicates whether the volume truncates files longer than its maximum supported length.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/truncatesLongNames
	TruncatesLongNames() bool

	// The maximum size of a regular file allowed in the volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumFileSize
	MaximumFileSize() uint64

	// The minimum number of bits needed to represent, as a signed integer value, the maximum size of a regular file allowed in the volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumFileSizeInBits
	MaximumFileSizeInBits() int

	// The maximum extended attribute size in bytes.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumXattrSize
	MaximumXattrSize() int

	// The maximum extended attribute size in bits.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumXattrSizeInBits
	MaximumXattrSizeInBits() int
}

Properties implemented by volumes that support providing the values of system limits or options.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations

type FSVolumePathConfOperationsObject

type FSVolumePathConfOperationsObject struct {
	objectivec.Object
}

FSVolumePathConfOperationsObject wraps an existing Objective-C object that conforms to the FSVolumePathConfOperations protocol.

func FSVolumePathConfOperationsObjectFromID

func FSVolumePathConfOperationsObjectFromID(id objc.ID) FSVolumePathConfOperationsObject

FSVolumePathConfOperationsObjectFromID constructs a FSVolumePathConfOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumePathConfOperationsObject) BaseObject

func (FSVolumePathConfOperationsObject) MaximumFileSize

func (o FSVolumePathConfOperationsObject) MaximumFileSize() uint64

The maximum size of a regular file allowed in the volume.

Discussion

Implement at least one of `maximumFileSize` or [MaximumFileSizeInBits]. FSKit automatically converts from one to another if needed. If you implement both, FSKit uses only the `maximumFileSizeInBits` implementation.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumFileSize

func (FSVolumePathConfOperationsObject) MaximumFileSizeInBits

func (o FSVolumePathConfOperationsObject) MaximumFileSizeInBits() int

The minimum number of bits needed to represent, as a signed integer value, the maximum size of a regular file allowed in the volume.

Discussion

The maximum file size is `2^(maximumFileSizeInBits - 1)`.

[Table data omitted]

Implement at least one of [MaximumFileSize] or `maximumFileSizeInBits`. FSKit automatically converts from one to another if needed. If you implement both, FSKit uses only the `maximumFileSizeInBits` implementation.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumFileSizeInBits

func (FSVolumePathConfOperationsObject) MaximumLinkCount

func (o FSVolumePathConfOperationsObject) MaximumLinkCount() int

A property that represents the maximum number of hard links to the object.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumLinkCount

func (FSVolumePathConfOperationsObject) MaximumNameLength

func (o FSVolumePathConfOperationsObject) MaximumNameLength() int

A property that represents the maximum length of a component of a filename.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumNameLength

func (FSVolumePathConfOperationsObject) MaximumXattrSize

func (o FSVolumePathConfOperationsObject) MaximumXattrSize() int

The maximum extended attribute size in bytes.

Discussion

Implement at least one of `maximumXattrSize` or [MaximumXattrSizeInBits]. FSKit automatically converts from one to another if needed. If you implement both, FSKit uses only the `maximumXattrSizeInBits` implementation.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumXattrSize

func (FSVolumePathConfOperationsObject) MaximumXattrSizeInBits

func (o FSVolumePathConfOperationsObject) MaximumXattrSizeInBits() int

The maximum extended attribute size in bits.

Discussion

Implement at least one of [MaximumXattrSize] or `maximumXattrSizeInBits`. FSKit automatically converts from one to another if needed. If you implement both, FSKit uses only the `maximumXattrSizeInBits` implementation.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/maximumXattrSizeInBits

func (FSVolumePathConfOperationsObject) RestrictsOwnershipChanges

func (o FSVolumePathConfOperationsObject) RestrictsOwnershipChanges() bool

A Boolean property that indicates whether the volume restricts ownership changes based on authorization.

Discussion

If this value is true, the volume rejects a `chown(2)` from anyone other than the superuser.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/restrictsOwnershipChanges

func (FSVolumePathConfOperationsObject) TruncatesLongNames

func (o FSVolumePathConfOperationsObject) TruncatesLongNames() bool

A property that indicates whether the volume truncates files longer than its maximum supported length.

Discussion

If this value is `true`, the volume truncates the filename to [MaximumNameLength] if the filename is longer than that. If this value is false, the file system responds with the error code [ENAMETOOLONG] if the filename is longer than [MaximumNameLength].

See: https://developer.apple.com/documentation/FSKit/FSVolume/PathConfOperations/truncatesLongNames

type FSVolumePreallocateOperations

type FSVolumePreallocateOperations interface {
	objectivec.IObject

	// Prealocates disk space for the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/preallocateSpace(for:at:length:flags:replyHandler:)
	PreallocateSpaceForItemAtOffsetLengthFlagsReplyHandler(item IFSItem, offset int64, length uintptr, flags FSPreallocateFlags, reply size_tErrorHandler)

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/isPreallocateInhibited
	IsPreallocateInhibited() bool

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/isPreallocateInhibited
	PreallocateInhibited() bool
	SetPreallocateInhibited(value bool)
}

Methods and properties implemented by volumes that want to offer preallocation functions.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations

type FSVolumePreallocateOperationsObject

type FSVolumePreallocateOperationsObject struct {
	objectivec.Object
}

FSVolumePreallocateOperationsObject wraps an existing Objective-C object that conforms to the FSVolumePreallocateOperations protocol.

func FSVolumePreallocateOperationsObjectFromID

func FSVolumePreallocateOperationsObjectFromID(id objc.ID) FSVolumePreallocateOperationsObject

FSVolumePreallocateOperationsObjectFromID constructs a FSVolumePreallocateOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumePreallocateOperationsObject) BaseObject

func (FSVolumePreallocateOperationsObject) IsPreallocateInhibited

func (o FSVolumePreallocateOperationsObject) IsPreallocateInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/isPreallocateInhibited

func (FSVolumePreallocateOperationsObject) PreallocateInhibited

func (o FSVolumePreallocateOperationsObject) PreallocateInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/isPreallocateInhibited

func (FSVolumePreallocateOperationsObject) PreallocateSpaceForItemAtOffsetLengthFlagsReplyHandler

func (o FSVolumePreallocateOperationsObject) PreallocateSpaceForItemAtOffsetLengthFlagsReplyHandler(item IFSItem, offset int64, length uintptr, flags FSPreallocateFlags, reply size_tErrorHandler)

Prealocates disk space for the given item.

item: The item for which to preallocate space.

offset: The offset from which to allocate.

length: The length of the space in bytes.

flags: Flags that affect the preallocation behavior.

reply: A block or closure to indicate success or failure. If preallocation succeeds, pass the amount of bytes allocated and a `nil` error. If preallocation fails, pass the relevant error as the second parameter; FSKit ignores any byte count in this case. For an `async` Swift implementation, there’s no reply handler; simply return the allocated byte count or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/PreallocateOperations/preallocateSpace(for:at:length:flags:replyHandler:)

func (FSVolumePreallocateOperationsObject) SetPreallocateInhibited

func (o FSVolumePreallocateOperationsObject) SetPreallocateInhibited(value bool)

type FSVolumeReadWriteOperations

type FSVolumeReadWriteOperations interface {
	objectivec.IObject

	// Reads the contents of the given file item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/ReadWriteOperations/read(from:at:length:into:replyHandler:)
	ReadFromFileOffsetLengthIntoBufferReplyHandler(item IFSItem, offset int64, length uintptr, buffer IFSMutableFileDataBuffer, reply size_tErrorHandler)

	// Writes contents to the given file item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/ReadWriteOperations/write(contents:to:at:replyHandler:)
	WriteContentsToFileAtOffsetReplyHandler(contents foundation.NSData, item IFSItem, offset int64, reply size_tErrorHandler)
}

Methods implemented for read and write operations that deliver data to and from the extension.

See: https://developer.apple.com/documentation/FSKit/FSVolume/ReadWriteOperations

type FSVolumeReadWriteOperationsObject

type FSVolumeReadWriteOperationsObject struct {
	objectivec.Object
}

FSVolumeReadWriteOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeReadWriteOperations protocol.

func FSVolumeReadWriteOperationsObjectFromID

func FSVolumeReadWriteOperationsObjectFromID(id objc.ID) FSVolumeReadWriteOperationsObject

FSVolumeReadWriteOperationsObjectFromID constructs a FSVolumeReadWriteOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeReadWriteOperationsObject) BaseObject

func (FSVolumeReadWriteOperationsObject) ReadFromFileOffsetLengthIntoBufferReplyHandler

func (o FSVolumeReadWriteOperationsObject) ReadFromFileOffsetLengthIntoBufferReplyHandler(item IFSItem, offset int64, length uintptr, buffer IFSMutableFileDataBuffer, reply size_tErrorHandler)

Reads the contents of the given file item.

item: The item from which to read. FSKit guarantees this item will be of type FSItemTypeFile.

offset: The offset in the file from which to start reading.

length: The number of bytes to read.

buffer: A buffer to receive the bytes read from the file.

reply: A block or closure to indicate success or failure. If reading succeeds, pass the number of bytes read and a `nil` error. If reading fails, pass the number of bytes read prior to the error along with the relevant error. For an `async` Swift implementation, there’s no reply handler; simply return the byte count or throw an error.

Discussion

If the number of bytes requested exceeds the number of bytes available before the end of the file, then the call copies only those bytes to `buffer`. If `offset` points past the last valid byte of the file, don’t reply with an error but set `actuallyRead` to `0`.

See: https://developer.apple.com/documentation/FSKit/FSVolume/ReadWriteOperations/read(from:at:length:into:replyHandler:)

func (FSVolumeReadWriteOperationsObject) WriteContentsToFileAtOffsetReplyHandler

func (o FSVolumeReadWriteOperationsObject) WriteContentsToFileAtOffsetReplyHandler(contents foundation.NSData, item IFSItem, offset int64, reply size_tErrorHandler)

Writes contents to the given file item.

contents: A buffer containing the data to write to the file.

item: The item to which to write. FSKit guarantees this item will be of type FSItemTypeFile.

offset: The offset in the file from which to start writing.

reply: A block or closure to indicate success or failure. If writing succeeds, pass the number of bytes written and a `nil` error. If writing fails, pass the number of bytes written prior to the error along with the relevant error. For an `async` Swift implementation, there’s no reply handler; simply return the byte count or throw an error.

Discussion

FSKit expects this routine to allocate space in the file system to extend the file as necessary.

If the volume experiences an out-of-space condition, reply with an error of domain NSPOSIXErrorDomain and code [ENOSPC].

See: https://developer.apple.com/documentation/FSKit/FSVolume/ReadWriteOperations/write(contents:to:at:replyHandler:)

type FSVolumeRenameOperations

type FSVolumeRenameOperations interface {
	objectivec.IObject

	// Sets a new name for the volume.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/setVolumeName(_:replyHandler:)
	SetVolumeNameReplyHandler(name IFSFileName, reply FSFileNameErrorHandler)

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/isVolumeRenameInhibited
	IsVolumeRenameInhibited() bool

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/isVolumeRenameInhibited
	VolumeRenameInhibited() bool
	SetVolumeRenameInhibited(value bool)
}

Methods and properties implemented by volumes that support renaming the volume.

See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations

type FSVolumeRenameOperationsObject

type FSVolumeRenameOperationsObject struct {
	objectivec.Object
}

FSVolumeRenameOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeRenameOperations protocol.

func FSVolumeRenameOperationsObjectFromID

func FSVolumeRenameOperationsObjectFromID(id objc.ID) FSVolumeRenameOperationsObject

FSVolumeRenameOperationsObjectFromID constructs a FSVolumeRenameOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeRenameOperationsObject) BaseObject

func (FSVolumeRenameOperationsObject) IsVolumeRenameInhibited

func (o FSVolumeRenameOperationsObject) IsVolumeRenameInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/isVolumeRenameInhibited

func (FSVolumeRenameOperationsObject) SetVolumeNameReplyHandler

func (o FSVolumeRenameOperationsObject) SetVolumeNameReplyHandler(name IFSFileName, reply FSFileNameErrorHandler)

Sets a new name for the volume.

name: The new volume name.

reply: A block or closure to indicate success or failure. If renaming succeeds, pass an FSFileName of the new volume name and a `nil` error. If renaming fails, pass the relevant error as the second parameter; FSKit ignores any FSFileName in this case. For an `async` Swift implementation, there’s no reply handler; simply return the FSFileName or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/setVolumeName(_:replyHandler:)

func (FSVolumeRenameOperationsObject) SetVolumeRenameInhibited

func (o FSVolumeRenameOperationsObject) SetVolumeRenameInhibited(value bool)

func (FSVolumeRenameOperationsObject) VolumeRenameInhibited

func (o FSVolumeRenameOperationsObject) VolumeRenameInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/RenameOperations/isVolumeRenameInhibited

type FSVolumeSupportedCapabilities

type FSVolumeSupportedCapabilities struct {
	objectivec.Object
}

A type that represents capabillities supported by a volume, such as hard and symbolic links, journaling, and large file sizes.

Declaring identifier capabilities

Declaring linking capabilities

Declaring journaling capabilities

Declaring root capabilites

Declaring file capabilities

Declaring volume capabilities

Working with case sensitivity

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities

func FSVolumeSupportedCapabilitiesFromID

func FSVolumeSupportedCapabilitiesFromID(id objc.ID) FSVolumeSupportedCapabilities

FSVolumeSupportedCapabilitiesFromID constructs a FSVolumeSupportedCapabilities from an objc.ID.

A type that represents capabillities supported by a volume, such as hard and symbolic links, journaling, and large file sizes.

func NewFSVolumeSupportedCapabilities

func NewFSVolumeSupportedCapabilities() FSVolumeSupportedCapabilities

NewFSVolumeSupportedCapabilities creates a new FSVolumeSupportedCapabilities instance.

func (FSVolumeSupportedCapabilities) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (FSVolumeSupportedCapabilities) CaseFormat

A value that indicates the volume’s support for case sensitivity.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/caseFormat

func (FSVolumeSupportedCapabilities) DoesNotSupportImmutableFiles

func (v FSVolumeSupportedCapabilities) DoesNotSupportImmutableFiles() bool

A Boolean property that indicates the volume doesn’t support immutable files.

Discussion

A `true` value means this volume doesn’t support setting the `UF_IMMUTABLE` flag.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/doesNotSupportImmutableFiles

func (FSVolumeSupportedCapabilities) DoesNotSupportRootTimes

func (v FSVolumeSupportedCapabilities) DoesNotSupportRootTimes() bool

A Boolan property that indicates the volume doesn’t store reliable times for the root directory.

Discussion

If this value is `true` (Swift) or [YES] (Objective-C), the volume doesn’t store reliable times for the root directory.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/doesNotSupportRootTimes

func (FSVolumeSupportedCapabilities) DoesNotSupportSettingFilePermissions

func (v FSVolumeSupportedCapabilities) DoesNotSupportSettingFilePermissions() bool

A Boolean property that indicates the volume doesn’t set file permissions.

Discussion

If this value is `true` (Swift) or [YES] (Objective-C), the volume doesn’t support setting file permissions.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/doesNotSupportSettingFilePermissions

func (FSVolumeSupportedCapabilities) DoesNotSupportVolumeSizes

func (v FSVolumeSupportedCapabilities) DoesNotSupportVolumeSizes() bool

A Boolean property that indicates the volume doesn’t support certain volume size reports.

Discussion

A true value means the volume doesn’t support determining values for total data blocks, available blocks, or free blocks, as in `f_blocks`, `f_bavail`, and `f_bfree` in the struct `statFS` returned by `statfs(2)`.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/doesNotSupportVolumeSizes

func (FSVolumeSupportedCapabilities) EncodeWithCoder

func (v FSVolumeSupportedCapabilities) EncodeWithCoder(coder foundation.INSCoder)

func (FSVolumeSupportedCapabilities) Init

Init initializes the instance.

func (FSVolumeSupportedCapabilities) SetCaseFormat

func (v FSVolumeSupportedCapabilities) SetCaseFormat(value FSVolumeCaseFormat)

func (FSVolumeSupportedCapabilities) SetDoesNotSupportImmutableFiles

func (v FSVolumeSupportedCapabilities) SetDoesNotSupportImmutableFiles(value bool)

func (FSVolumeSupportedCapabilities) SetDoesNotSupportRootTimes

func (v FSVolumeSupportedCapabilities) SetDoesNotSupportRootTimes(value bool)

func (FSVolumeSupportedCapabilities) SetDoesNotSupportSettingFilePermissions

func (v FSVolumeSupportedCapabilities) SetDoesNotSupportSettingFilePermissions(value bool)

func (FSVolumeSupportedCapabilities) SetDoesNotSupportVolumeSizes

func (v FSVolumeSupportedCapabilities) SetDoesNotSupportVolumeSizes(value bool)

func (FSVolumeSupportedCapabilities) SetSupports2TBFiles

func (v FSVolumeSupportedCapabilities) SetSupports2TBFiles(value bool)

func (FSVolumeSupportedCapabilities) SetSupports64BitObjectIDs

func (v FSVolumeSupportedCapabilities) SetSupports64BitObjectIDs(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsActiveJournal

func (v FSVolumeSupportedCapabilities) SetSupportsActiveJournal(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsDocumentID

func (v FSVolumeSupportedCapabilities) SetSupportsDocumentID(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsFastStatFS

func (v FSVolumeSupportedCapabilities) SetSupportsFastStatFS(value bool)
func (v FSVolumeSupportedCapabilities) SetSupportsHardLinks(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsHiddenFiles

func (v FSVolumeSupportedCapabilities) SetSupportsHiddenFiles(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsJournal

func (v FSVolumeSupportedCapabilities) SetSupportsJournal(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsOpenDenyModes

func (v FSVolumeSupportedCapabilities) SetSupportsOpenDenyModes(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsPersistentObjectIDs

func (v FSVolumeSupportedCapabilities) SetSupportsPersistentObjectIDs(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsSharedSpace

func (v FSVolumeSupportedCapabilities) SetSupportsSharedSpace(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsSparseFiles

func (v FSVolumeSupportedCapabilities) SetSupportsSparseFiles(value bool)
func (v FSVolumeSupportedCapabilities) SetSupportsSymbolicLinks(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsVolumeGroups

func (v FSVolumeSupportedCapabilities) SetSupportsVolumeGroups(value bool)

func (FSVolumeSupportedCapabilities) SetSupportsZeroRuns

func (v FSVolumeSupportedCapabilities) SetSupportsZeroRuns(value bool)

func (FSVolumeSupportedCapabilities) Supports2TBFiles

func (v FSVolumeSupportedCapabilities) Supports2TBFiles() bool

A Boolean property that indicates whether the volume supports file sizes larger than 4GB, and potentially up to 2TB.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supports2TBFiles

func (FSVolumeSupportedCapabilities) Supports64BitObjectIDs

func (v FSVolumeSupportedCapabilities) Supports64BitObjectIDs() bool

A Boolean property that indicates whether the volume supports 64-bit object IDs.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supports64BitObjectIDs

func (FSVolumeSupportedCapabilities) SupportsActiveJournal

func (v FSVolumeSupportedCapabilities) SupportsActiveJournal() bool

A Boolean property that indicates whether the volume currently uses a journal for speeding recovery after an unplanned shutdown.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsActiveJournal

func (FSVolumeSupportedCapabilities) SupportsDocumentID

func (v FSVolumeSupportedCapabilities) SupportsDocumentID() bool

A Boolean property that indicates whether the volume supports document IDs for document revisions.

Discussion

A document ID is an identifier that persists across object ID changes.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsDocumentID

func (FSVolumeSupportedCapabilities) SupportsFastStatFS

func (v FSVolumeSupportedCapabilities) SupportsFastStatFS() bool

A Boolean property that indicates whether the volume supports fast results when fetching file system statistics.

Discussion

A true value means this volume hints to upper layers to indicate that `statfs(2)` is fast enough that its results need not be cached by the caller.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsFastStatFS

func (v FSVolumeSupportedCapabilities) SupportsHardLinks() bool

A Boolean property that indicates whether the volume supports hard links.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsHardLinks

func (FSVolumeSupportedCapabilities) SupportsHiddenFiles

func (v FSVolumeSupportedCapabilities) SupportsHiddenFiles() bool

A Boolean property that indicates whether the volume supports hidden files.

Discussion

A `true` value means the volume supports the `UF_HIDDEN` file flag.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsHiddenFiles

func (FSVolumeSupportedCapabilities) SupportsJournal

func (v FSVolumeSupportedCapabilities) SupportsJournal() bool

A Boolean property that indicates whether the volume supports a journal used to speed recovery in case of unplanned restart, such as a power outage or crash.

Discussion

This property doesn’t necessarily mean the volume is actively using a journal.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsJournal

func (FSVolumeSupportedCapabilities) SupportsOpenDenyModes

func (v FSVolumeSupportedCapabilities) SupportsOpenDenyModes() bool

A Boolean property that indicates whether the volume supports open deny modes.

Discussion

These are modes such as “open for read write, deny write”.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsOpenDenyModes

func (FSVolumeSupportedCapabilities) SupportsPersistentObjectIDs

func (v FSVolumeSupportedCapabilities) SupportsPersistentObjectIDs() bool

A Boolean property that indicates whether the volume supports persistent object identifiers and can look up file system objects by their IDs.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsPersistentObjectIDs

func (FSVolumeSupportedCapabilities) SupportsSharedSpace

func (v FSVolumeSupportedCapabilities) SupportsSharedSpace() bool

A Boolean property that indicates whether the volume supports multiple logical file systems that share space in a single “partition.”

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsSharedSpace

func (FSVolumeSupportedCapabilities) SupportsSparseFiles

func (v FSVolumeSupportedCapabilities) SupportsSparseFiles() bool

A Boolean property that indicates whether the volume supports sparse files.

Discussion

A sparse file is a file that can have “holes” that the file system has never written to, and as a result don’t consume space on disk.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsSparseFiles

func (v FSVolumeSupportedCapabilities) SupportsSymbolicLinks() bool

A Boolean property that indicates whether the volume supports symbolic links.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsSymbolicLinks

func (FSVolumeSupportedCapabilities) SupportsVolumeGroups

func (v FSVolumeSupportedCapabilities) SupportsVolumeGroups() bool

A Boolean property that indicates whether the volume supports volume groups.

Discussion

Volume groups involve multiple logical file systems that the system can mount and unmount together, and for which the system can present common file system identifier information.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsVolumeGroups

func (FSVolumeSupportedCapabilities) SupportsZeroRuns

func (v FSVolumeSupportedCapabilities) SupportsZeroRuns() bool

A Boolean property that indicates whether the volume supports zero runs

Discussion

If this value is true, the volume keeps track of allocated but unwritten runs of a file so that it can substitute zeroes without actually writing zeroes to the media.

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities/supportsZeroRuns

type FSVolumeSupportedCapabilitiesClass

type FSVolumeSupportedCapabilitiesClass struct {
	// contains filtered or unexported fields
}

func GetFSVolumeSupportedCapabilitiesClass

func GetFSVolumeSupportedCapabilitiesClass() FSVolumeSupportedCapabilitiesClass

GetFSVolumeSupportedCapabilitiesClass returns the class object for FSVolumeSupportedCapabilities.

func (FSVolumeSupportedCapabilitiesClass) Alloc

Alloc allocates memory for a new instance of the class.

func (FSVolumeSupportedCapabilitiesClass) Class

Class returns the underlying Objective-C class pointer.

type FSVolumeXattrOperations

type FSVolumeXattrOperations interface {
	objectivec.IObject

	// Gets the specified extended attribute of the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/getXattr(named:of:replyHandler:)
	GetXattrNamedOfItemReplyHandler(name IFSFileName, item IFSItem, reply DataErrorHandler)

	// Gets the list of extended attributes currently set on the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/listXattrs(of:replyHandler:)
	ListXattrsOfItemReplyHandler(item IFSItem, reply FSFileNameArrayErrorHandler)

	// Sets the specified extended attribute data on the given item.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/setXattr(named:to:on:policy:replyHandler:)
	SetXattrNamedToDataOnItemPolicyReplyHandler(name IFSFileName, value foundation.NSData, item IFSItem, policy FSSetXattrPolicy, reply ErrorHandler)

	// A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
	//
	// See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/xattrOperationsInhibited
	XattrOperationsInhibited() bool
	SetXattrOperationsInhibited(value bool)
}

Methods and properties implemented by volumes that natively or partially support extended attributes.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations

type FSVolumeXattrOperationsObject

type FSVolumeXattrOperationsObject struct {
	objectivec.Object
}

FSVolumeXattrOperationsObject wraps an existing Objective-C object that conforms to the FSVolumeXattrOperations protocol.

func FSVolumeXattrOperationsObjectFromID

func FSVolumeXattrOperationsObjectFromID(id objc.ID) FSVolumeXattrOperationsObject

FSVolumeXattrOperationsObjectFromID constructs a FSVolumeXattrOperationsObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (FSVolumeXattrOperationsObject) BaseObject

func (FSVolumeXattrOperationsObject) GetXattrNamedOfItemReplyHandler

func (o FSVolumeXattrOperationsObject) GetXattrNamedOfItemReplyHandler(name IFSFileName, item IFSItem, reply DataErrorHandler)

Gets the specified extended attribute of the given item.

name: The extended attribute name.

item: The item for which to get the extended attribute.

reply: A block or closure to indicate success or failure. If getting the attribute succeeds, pass an data instance containing the extended attribute data and a `nil` error. If getting the attribute fails, pass the relevant error as the second parameter; FSKit ignores any data in this case. For an `async` Swift implementation, there’s no reply handler; simply return the data or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/getXattr(named:of:replyHandler:)

func (FSVolumeXattrOperationsObject) ListXattrsOfItemReplyHandler added in v0.6.10

func (o FSVolumeXattrOperationsObject) ListXattrsOfItemReplyHandler(item IFSItem, reply FSFileNameArrayErrorHandler)

Gets the list of extended attributes currently set on the given item.

item: The item from which to get extended attributes.

reply: A block or closure to indicate success or failure. If getting the list of extended attributes succeeds, pass the xattrs as an array of FSFileName instances and a `nil` error. If getting the attriubtes fails, pass `nil` along with the relevant error. For an `async` Swift implementation, there’s no reply handler; simply return the byte count or throw an error.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/listXattrs(of:replyHandler:)

func (FSVolumeXattrOperationsObject) SetXattrNamedToDataOnItemPolicyReplyHandler

func (o FSVolumeXattrOperationsObject) SetXattrNamedToDataOnItemPolicyReplyHandler(name IFSFileName, value foundation.NSData, item IFSItem, policy FSSetXattrPolicy, reply ErrorHandler)

Sets the specified extended attribute data on the given item.

name: The extended attribute name.

value: The extended attribute value to set. This can’t be `nil`, unless the policy is FSSetXattrPolicyDelete.

item: The item on which to set the extended attribute.

policy: The policy to apply when setting the attribute. See FSVolume.SetXattrPolicy for possible values.

reply: A block or closure to indicate success or failure. If setting the attribute fails, pass an error as the one parameter to the reply handler. If setting the attribute succeeds, pass `nil`. For an `async` Swift implementation, there’s no reply handler; simply throw an error or return normally.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/setXattr(named:to:on:policy:replyHandler:)

func (FSVolumeXattrOperationsObject) SetXattrOperationsInhibited

func (o FSVolumeXattrOperationsObject) SetXattrOperationsInhibited(value bool)

func (FSVolumeXattrOperationsObject) SupportedXattrNamesForItem

func (o FSVolumeXattrOperationsObject) SupportedXattrNamesForItem(item IFSItem) []FSFileName

Returns an array that specifies the extended attribute names the given item supports.

item: The item for which to get information.

Discussion

If `item` supports no extended attributes, this method returns `nil`.

Only implement this method if your volume works with “limited” extended attributes. For purposes of this protocol, “limited” support means the volume doesn’t support extended attributes generally, but uses these APIs to expose specific file system data.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/supportedXattrNames(for:)

func (FSVolumeXattrOperationsObject) XattrOperationsInhibited

func (o FSVolumeXattrOperationsObject) XattrOperationsInhibited() bool

A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.

Discussion

FSKit reads this value after the file system replies to the `loadResource` message. Changing the returned value during the runtime of the volume has no effect.

See: https://developer.apple.com/documentation/FSKit/FSVolume/XattrOperations/xattrOperationsInhibited

type IFSBlockDeviceResource

type IFSBlockDeviceResource interface {
	IFSResource

	// The device name of the resource.
	BSDName() string
	// A Boolean property that indicates whether the resource can write data to the device.
	IsWritable() bool
	// The block count on this resource.
	BlockCount() uint64
	// The logical block size, the size of data blocks used by the file system.
	BlockSize() uint64
	// The sector size of the device.
	PhysicalBlockSize() uint64

	// Synchronously flushes the resource’s buffer cache.
	MetadataFlushWithError() (bool, error)
	// Asynchronously flushes the resource’s buffer cache.
	AsynchronousMetadataFlushWithError() (bool, error)
	// Clears the given ranges within the buffer cache.
	MetadataClearWithDelayedWritesError(rangesToClear []FSMetadataRange, withDelayedWrites bool) (bool, error)
	// Synchronously purges the given ranges from the buffer cache.
	MetadataPurgeError(rangesToPurge []FSMetadataRange) (bool, error)

	// Writes file system metadata from a buffer to a cache, prior to flushing it to the resource.
	DelayedMetadataWriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)
	// Synchronously reads file system metadata from the resource into a buffer.
	MetadataReadIntoStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)
	// Synchronously writes file system metadata from a buffer to the resource.
	MetadataWriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (bool, error)
	// Reads data from the resource into a buffer and executes a block afterwards.
	ReadIntoStartingAtLengthCompletionHandler(buffer unsafe.Pointer, offset int64, length uintptr, completionHandler size_tErrorHandler)
	// Synchronously reads data from the resource into a buffer.
	ReadIntoStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (uintptr, error)
	// Writes data from from a buffer to the resource and executes a block afterwards.
	WriteFromStartingAtLengthCompletionHandler(buffer unsafe.Pointer, offset int64, length uintptr, completionHandler size_tErrorHandler)
	// Synchronously writes data from from a buffer to the resource and executes a block afterwards.
	WriteFromStartingAtLengthError(buffer kernel.Pointer, offset int64, length uintptr) (uintptr, error)
}

An interface definition for the FSBlockDeviceResource class.

Accessing resource properties

  • [IFSBlockDeviceResource.BSDName]: The device name of the resource.
  • [IFSBlockDeviceResource.IsWritable]: A Boolean property that indicates whether the resource can write data to the device.
  • [IFSBlockDeviceResource.BlockCount]: The block count on this resource.
  • [IFSBlockDeviceResource.BlockSize]: The logical block size, the size of data blocks used by the file system.
  • [IFSBlockDeviceResource.PhysicalBlockSize]: The sector size of the device.

Reading and writing data with kernel buffer cache

  • [IFSBlockDeviceResource.MetadataFlushWithError]: Synchronously flushes the resource’s buffer cache.
  • [IFSBlockDeviceResource.AsynchronousMetadataFlushWithError]: Asynchronously flushes the resource’s buffer cache.
  • [IFSBlockDeviceResource.MetadataClearWithDelayedWritesError]: Clears the given ranges within the buffer cache.
  • [IFSBlockDeviceResource.MetadataPurgeError]: Synchronously purges the given ranges from the buffer cache.

See: https://developer.apple.com/documentation/FSKit/FSBlockDeviceResource

type IFSClient

type IFSClient interface {
	objectivec.IObject

	// Asynchronously retrieves an list of installed file system modules.
	FetchInstalledExtensionsWithCompletionHandler(completionHandler FSModuleIdentityArrayErrorHandler)

	// Fetches installed FSKit modules using the FSClient XPC method.
	InstalledExtensions(handler FSModuleIdentityArrayErrorHandler)
	// Fetches installed FSKit modules using the FSClient synchronous XPC method.
	InstalledExtensionsSync(handler FSModuleIdentityArrayErrorHandler)
	// Sets the enabled state for an FSKit module.
	SetEnabledStateForIdentifier(identifier string, enabled bool, handler ErrorHandler)
}

An interface definition for the FSClient class.

Discovering installed extensions

  • [IFSClient.FetchInstalledExtensionsWithCompletionHandler]: Asynchronously retrieves an list of installed file system modules.

See: https://developer.apple.com/documentation/FSKit/FSClient

type IFSContainerIdentifier

type IFSContainerIdentifier interface {
	IFSEntityIdentifier

	// The volume identifier associated with the container.
	VolumeIdentifier() IFSVolumeIdentifier
}

An interface definition for the FSContainerIdentifier class.

Accessing identifier properties

  • [IFSContainerIdentifier.VolumeIdentifier]: The volume identifier associated with the container.

See: https://developer.apple.com/documentation/FSKit/FSContainerIdentifier

type IFSContainerStatus

type IFSContainerStatus interface {
	objectivec.IObject

	// A value that represents the container state, such as ready, active, or blocked.
	State() FSContainerState
	// An optional error that provides further information about the state.
	Status() foundation.NSError
}

An interface definition for the FSContainerStatus class.

Inspecting status properties

  • [IFSContainerStatus.State]: A value that represents the container state, such as ready, active, or blocked.
  • [IFSContainerStatus.Status]: An optional error that provides further information about the state.

See: https://developer.apple.com/documentation/FSKit/FSContainerStatus

type IFSDirectoryEntryPacker

type IFSDirectoryEntryPacker interface {
	objectivec.IObject

	// Provides a directory entry during enumeration.
	PackEntryWithNameItemTypeItemIDNextCookieAttributes(name IFSFileName, itemType FSItemType, itemID FSItemID, nextCookie FSDirectoryCookie, attributes IFSItemAttributes) bool
}

An interface definition for the FSDirectoryEntryPacker class.

Packing entries

  • [IFSDirectoryEntryPacker.PackEntryWithNameItemTypeItemIDNextCookieAttributes]: Provides a directory entry during enumeration.

See: https://developer.apple.com/documentation/FSKit/FSDirectoryEntryPacker

type IFSEntityIdentifier

type IFSEntityIdentifier interface {
	objectivec.IObject

	// Creates an entity identifier with the given UUID.
	InitWithUUID(uuid foundation.NSUUID) FSEntityIdentifier
	// Creates an entity identifier with the given UUID and qualifier data.
	InitWithUUIDData(uuid foundation.NSUUID, qualifierData foundation.NSData) FSEntityIdentifier
	// Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.
	InitWithUUIDQualifier(uuid foundation.NSUUID, qualifier uint64) FSEntityIdentifier

	// A UUID to uniquely identify this entity.
	Uuid() foundation.NSUUID
	SetUuid(value foundation.NSUUID)
	// An optional piece of data to distinguish entities that otherwise share the same UUID.
	Qualifier() foundation.NSData
	SetQualifier(value foundation.NSData)

	InitWithCoder(coder foundation.INSCoder) FSEntityIdentifier

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSEntityIdentifier class.

Creating an entity identifier

  • [IFSEntityIdentifier.InitWithUUID]: Creates an entity identifier with the given UUID.
  • [IFSEntityIdentifier.InitWithUUIDData]: Creates an entity identifier with the given UUID and qualifier data.
  • [IFSEntityIdentifier.InitWithUUIDQualifier]: Creates an entity identifier with the given UUID and qualifier data as a 64-bit unsigned integer.

Inspecting identifier properties

  • [IFSEntityIdentifier.Uuid]: A UUID to uniquely identify this entity.
  • [IFSEntityIdentifier.SetUuid]
  • [IFSEntityIdentifier.Qualifier]: An optional piece of data to distinguish entities that otherwise share the same UUID.
  • [IFSEntityIdentifier.SetQualifier]

Initializers

  • [IFSEntityIdentifier.InitWithCoder]

See: https://developer.apple.com/documentation/FSKit/FSEntityIdentifier

type IFSExtentPacker

type IFSExtentPacker interface {
	objectivec.IObject

	// Packs a single extent to send to the kernel.
	PackExtentWithResourceTypeLogicalOffsetPhysicalOffsetLength(resource IFSBlockDeviceResource, type_ FSExtentType, logicalOffset int64, physicalOffset int64, length uintptr) bool
}

An interface definition for the FSExtentPacker class.

Packing extents

  • [IFSExtentPacker.PackExtentWithResourceTypeLogicalOffsetPhysicalOffsetLength]: Packs a single extent to send to the kernel.

See: https://developer.apple.com/documentation/FSKit/FSExtentPacker

type IFSFileName

type IFSFileName interface {
	objectivec.IObject

	// Creates a filename by copying a character sequence data object.
	InitWithData(name foundation.NSData) FSFileName
	// Creates a filename by copying a character sequence from a string instance.
	InitWithString(name string) FSFileName

	// The byte sequence of the filename, as a data object.
	Data() foundation.NSData
	// The filename, represented as a Unicode string.
	String() string
	// The filename, represented as a potentially lossy conversion to a string.
	DebugDescription() string

	InitWithCoder(coder foundation.INSCoder) FSFileName

	// Initializes a file name by copying a character sequence from a byte array.
	InitWithBytesLength(bytes string, length uint) FSFileName
	// Initializes a filename from a null-terminated character sequence.
	InitWithCString(name string) FSFileName
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSFileName class.

Creating a filename

  • [IFSFileName.InitWithData]: Creates a filename by copying a character sequence data object.
  • [IFSFileName.InitWithString]: Creates a filename by copying a character sequence from a string instance.

Accessing filename properties

  • [IFSFileName.Data]: The byte sequence of the filename, as a data object.
  • [IFSFileName.String]: The filename, represented as a Unicode string.
  • [IFSFileName.DebugDescription]: The filename, represented as a potentially lossy conversion to a string.

Initializers

  • [IFSFileName.InitWithCoder]

See: https://developer.apple.com/documentation/FSKit/FSFileName

type IFSFileSystem

type IFSFileSystem interface {
	objectivec.IObject
}

An interface definition for the FSFileSystem class.

See: https://developer.apple.com/documentation/FSKit/FSFileSystem

type IFSGenericURLResource

type IFSGenericURLResource interface {
	IFSResource

	// Creates a generic URL resource with the given URL.
	InitWithURL(url foundation.NSURL) FSGenericURLResource

	// The URL represented by the resource.
	Url() foundation.NSURL
}

An interface definition for the FSGenericURLResource class.

Creating a generic URL resource

  • [IFSGenericURLResource.InitWithURL]: Creates a generic URL resource with the given URL.

Accessing resource properties

  • [IFSGenericURLResource.Url]: The URL represented by the resource.

See: https://developer.apple.com/documentation/FSKit/FSGenericURLResource

type IFSItem

type IFSItem interface {
	objectivec.IObject

	// The attributes successfully used by the file system.
	ConsumedAttributes() unsafe.Pointer
	SetConsumedAttributes(value kernel.Pointer)
	// The attributes requested by the request.
	WantedAttributes() unsafe.Pointer
	SetWantedAttributes(value kernel.Pointer)
}

An interface definition for the FSItem class.

See: https://developer.apple.com/documentation/FSKit/FSItem

type IFSItemAttributes

type IFSItemAttributes interface {
	objectivec.IObject

	// Returns a Boolean value that indicates whether the attribute is valid.
	IsValid(attribute FSItemAttribute) bool
	// Marks all attributes inactive.
	InvalidateAllProperties()

	// The item’s file identifier.
	FileID() FSItemID
	SetFileID(value FSItemID)
	// The identifier of the item’s parent.
	ParentID() FSItemID
	SetParentID(value FSItemID)

	// The item type, such as a regular file, directory, or symbolic link.
	Type() FSItemType
	SetType(value FSItemType)
	// The mode of the item.
	Mode() uint32
	SetMode(value uint32)
	// The number of hard links to the item.
	LinkCount() uint32
	SetLinkCount(value uint32)
	// The user identifier.
	Uid() uint32
	SetUid(value uint32)
	// The group identifier.
	Gid() uint32
	SetGid(value uint32)
	// The item’s behavior flags.
	Flags() uint32
	SetFlags(value uint32)
	// The item’s size.
	Size() uint64
	SetSize(value uint64)
	// The item’s allocated size.
	AllocSize() uint64
	SetAllocSize(value uint64)
	// A Boolean value that indicates whether the item supports a limited set of extended attributes.
	SupportsLimitedXAttrs() bool
	SetSupportsLimitedXAttrs(value bool)
	// A Boolean value that indicates whether the file system overrides the per-volume settings for kernel offloaded I/O for a specific file.
	InhibitKernelOffloadedIO() bool
	SetInhibitKernelOffloadedIO(value bool)

	// The item’s last-accessed time.
	AccessTime() syscall.Timespec
	SetAccessTime(value syscall.Timespec)
	// The item’s last-modified time.
	ModifyTime() syscall.Timespec
	SetModifyTime(value syscall.Timespec)
	// The item’s last-changed time.
	ChangeTime() syscall.Timespec
	SetChangeTime(value syscall.Timespec)
	// The item’s creation time.
	BirthTime() syscall.Timespec
	SetBirthTime(value syscall.Timespec)
	// The item’s last-backup time.
	BackupTime() syscall.Timespec
	SetBackupTime(value syscall.Timespec)
	// The item’s added time.
	AddedTime() syscall.Timespec
	SetAddedTime(value syscall.Timespec)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSItemAttributes class.

Validating and invalidating attributes

  • [IFSItemAttributes.IsValid]: Returns a Boolean value that indicates whether the attribute is valid.
  • [IFSItemAttributes.InvalidateAllProperties]: Marks all attributes inactive.

Working with identifier attributes

  • [IFSItemAttributes.FileID]: The item’s file identifier.
  • [IFSItemAttributes.SetFileID]
  • [IFSItemAttributes.ParentID]: The identifier of the item’s parent.
  • [IFSItemAttributes.SetParentID]

Working with metadata attributes

  • [IFSItemAttributes.Type]: The item type, such as a regular file, directory, or symbolic link.
  • [IFSItemAttributes.SetType]
  • [IFSItemAttributes.Mode]: The mode of the item.
  • [IFSItemAttributes.SetMode]
  • [IFSItemAttributes.LinkCount]: The number of hard links to the item.
  • [IFSItemAttributes.SetLinkCount]
  • [IFSItemAttributes.Uid]: The user identifier.
  • [IFSItemAttributes.SetUid]
  • [IFSItemAttributes.Gid]: The group identifier.
  • [IFSItemAttributes.SetGid]
  • [IFSItemAttributes.Flags]: The item’s behavior flags.
  • [IFSItemAttributes.SetFlags]
  • [IFSItemAttributes.Size]: The item’s size.
  • [IFSItemAttributes.SetSize]
  • [IFSItemAttributes.AllocSize]: The item’s allocated size.
  • [IFSItemAttributes.SetAllocSize]
  • [IFSItemAttributes.SupportsLimitedXAttrs]: A Boolean value that indicates whether the item supports a limited set of extended attributes.
  • [IFSItemAttributes.SetSupportsLimitedXAttrs]
  • [IFSItemAttributes.InhibitKernelOffloadedIO]: A Boolean value that indicates whether the file system overrides the per-volume settings for kernel offloaded I/O for a specific file.
  • [IFSItemAttributes.SetInhibitKernelOffloadedIO]

Working with time attributes

  • [IFSItemAttributes.AccessTime]: The item’s last-accessed time.
  • [IFSItemAttributes.SetAccessTime]
  • [IFSItemAttributes.ModifyTime]: The item’s last-modified time.
  • [IFSItemAttributes.SetModifyTime]
  • [IFSItemAttributes.ChangeTime]: The item’s last-changed time.
  • [IFSItemAttributes.SetChangeTime]
  • [IFSItemAttributes.BirthTime]: The item’s creation time.
  • [IFSItemAttributes.SetBirthTime]
  • [IFSItemAttributes.BackupTime]: The item’s last-backup time.
  • [IFSItemAttributes.SetBackupTime]
  • [IFSItemAttributes.AddedTime]: The item’s added time.
  • [IFSItemAttributes.SetAddedTime]

See: https://developer.apple.com/documentation/FSKit/FSItem/Attributes

type IFSItemGetAttributesRequest

type IFSItemGetAttributesRequest interface {
	objectivec.IObject

	// The attributes requested by the request.
	WantedAttributes() FSItemAttribute
	SetWantedAttributes(value FSItemAttribute)
	// A method that indicates whether the request wants given attribute.
	IsAttributeWanted(attribute FSItemAttribute) bool

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSItemGetAttributesRequest class.

Inspecting requested attributes

  • [IFSItemGetAttributesRequest.WantedAttributes]: The attributes requested by the request.
  • [IFSItemGetAttributesRequest.SetWantedAttributes]
  • [IFSItemGetAttributesRequest.IsAttributeWanted]: A method that indicates whether the request wants given attribute.

See: https://developer.apple.com/documentation/FSKit/FSItem/GetAttributesRequest

type IFSItemSetAttributesRequest

type IFSItemSetAttributesRequest interface {
	IFSItemAttributes

	// The attributes successfully used by the file system.
	ConsumedAttributes() FSItemAttribute
	SetConsumedAttributes(value FSItemAttribute)
	// A method that indicates whether the file system used the given attribute.
	WasAttributeConsumed(attribute FSItemAttribute) bool
}

An interface definition for the FSItemSetAttributesRequest class.

Inspecting used attributes

  • [IFSItemSetAttributesRequest.ConsumedAttributes]: The attributes successfully used by the file system.
  • [IFSItemSetAttributesRequest.SetConsumedAttributes]
  • [IFSItemSetAttributesRequest.WasAttributeConsumed]: A method that indicates whether the file system used the given attribute.

See: https://developer.apple.com/documentation/FSKit/FSItem/SetAttributesRequest

type IFSMetadataRange

type IFSMetadataRange interface {
	objectivec.IObject

	// Initializes a metadata range with the given properties.
	InitWithOffsetSegmentLengthSegmentCount(startOffset int64, segmentLength uint64, segmentCount uint64) FSMetadataRange

	// The start offset of the range in bytes.
	StartOffset() int64
	// The segment length in bytes.
	SegmentLength() uint64
	// The number of segments in the range.
	SegmentCount() uint64
}

An interface definition for the FSMetadataRange class.

Creating a metadata range

  • [IFSMetadataRange.InitWithOffsetSegmentLengthSegmentCount]: Initializes a metadata range with the given properties.

Accessing range properties

  • [IFSMetadataRange.StartOffset]: The start offset of the range in bytes.
  • [IFSMetadataRange.SegmentLength]: The segment length in bytes.
  • [IFSMetadataRange.SegmentCount]: The number of segments in the range.

See: https://developer.apple.com/documentation/FSKit/FSMetadataRange

type IFSModuleIdentity

type IFSModuleIdentity interface {
	objectivec.IObject

	// The module’s bundle identifier.
	BundleIdentifier() string
	// The module’s URL.
	Url() foundation.NSURL
	// A Boolean value that indicates if the module is enabled.
	IsEnabled() bool
}

An interface definition for the FSModuleIdentity class.

Accessing module properties

  • [IFSModuleIdentity.BundleIdentifier]: The module’s bundle identifier.
  • [IFSModuleIdentity.Url]: The module’s URL.
  • [IFSModuleIdentity.IsEnabled]: A Boolean value that indicates if the module is enabled.

See: https://developer.apple.com/documentation/FSKit/FSModuleIdentity

type IFSMutableFileDataBuffer

type IFSMutableFileDataBuffer interface {
	objectivec.IObject

	// The data length of the buffer.
	Length() uint

	// The byte data.
	MutableBytes() unsafe.Pointer
}

An interface definition for the FSMutableFileDataBuffer class.

Accessing buffer properties

  • [IFSMutableFileDataBuffer.Length]: The data length of the buffer.

See: https://developer.apple.com/documentation/FSKit/FSMutableFileDataBuffer

type IFSPathURLResource

type IFSPathURLResource interface {
	IFSResource

	// Creates a path URL resource.
	InitWithURLWritable(URL foundation.NSURL, writable bool) FSPathURLResource

	// The URL represented by the resource.
	Url() foundation.NSURL
	// A Boolean value that indicates whether the file system supports writing to the contents of the path URL.
	IsWritable() bool
}

An interface definition for the FSPathURLResource class.

Creating a path URL resource

  • [IFSPathURLResource.InitWithURLWritable]: Creates a path URL resource.

Accessing resource properties

  • [IFSPathURLResource.Url]: The URL represented by the resource.
  • [IFSPathURLResource.IsWritable]: A Boolean value that indicates whether the file system supports writing to the contents of the path URL.

See: https://developer.apple.com/documentation/FSKit/FSPathURLResource

type IFSProbeResult

type IFSProbeResult interface {
	objectivec.IObject

	// The container identifier, as found during the probe operation.
	ContainerID() IFSContainerIdentifier
	// The resource name, as found during the probe operation.
	Name() string
	// The match result, representing the recognition and usability of a probed resource.
	Result() FSMatchResult

	InitWithCoder(coder foundation.INSCoder) FSProbeResult

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSProbeResult class.

Working with result properties

  • [IFSProbeResult.ContainerID]: The container identifier, as found during the probe operation.
  • [IFSProbeResult.Name]: The resource name, as found during the probe operation.
  • [IFSProbeResult.Result]: The match result, representing the recognition and usability of a probed resource.

Initializers

  • [IFSProbeResult.InitWithCoder]

See: https://developer.apple.com/documentation/FSKit/FSProbeResult

type IFSResource

type IFSResource interface {
	objectivec.IObject

	// Creates a proxy object of this resource.
	MakeProxy() IFSResource

	// Revokes the resource.
	Revoke()
	// A Boolean value that indicates whether the resource is revoked.
	IsRevoked() bool

	InitWithCoder(coder foundation.INSCoder) FSResource

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSResource class.

Creating proxies

  • [IFSResource.MakeProxy]: Creates a proxy object of this resource.

Revoking the resource

  • [IFSResource.Revoke]: Revokes the resource.
  • [IFSResource.IsRevoked]: A Boolean value that indicates whether the resource is revoked.

Initializers

  • [IFSResource.InitWithCoder]

See: https://developer.apple.com/documentation/FSKit/FSResource

type IFSStatFSResult

type IFSStatFSResult interface {
	objectivec.IObject

	InitWithCoder(coder foundation.INSCoder) FSStatFSResult
	// Creates an statistics result instance, using the given file system type name.
	InitWithFileSystemTypeName(fileSystemTypeName string) FSStatFSResult

	// A property for the number of free blocks available to a non-superuser on the volume.
	AvailableBlocks() uint64
	SetAvailableBlocks(value uint64)
	// A property for the amount of space available to users, in bytes, in the volume.
	AvailableBytes() uint64
	SetAvailableBytes(value uint64)
	// A property for the volume’s block size, in bytes.
	BlockSize() int
	SetBlockSize(value int)
	// A property for the file system’s subtype or flavor.
	FileSystemSubType() int
	SetFileSystemSubType(value int)
	// A property for the file system type name.
	FileSystemTypeName() string
	// A property for the number of free blocks in the volume.
	FreeBlocks() uint64
	SetFreeBlocks(value uint64)
	// A property for the amount of free space, in bytes, in the volume.
	FreeBytes() uint64
	SetFreeBytes(value uint64)
	// A property for the total number of free file slots in the volume.
	FreeFiles() uint64
	SetFreeFiles(value uint64)
	// A property for the optimal block size with which to perform I/O.
	IoSize() int
	SetIoSize(value int)
	// A property for the volume’s total data block count.
	TotalBlocks() uint64
	SetTotalBlocks(value uint64)
	// A property for the total size, in bytes, of the volume.
	TotalBytes() uint64
	SetTotalBytes(value uint64)
	// A property for the total number of file slots in the volume,
	TotalFiles() uint64
	SetTotalFiles(value uint64)
	// A property for the number of used blocks in the volume.
	UsedBlocks() uint64
	SetUsedBlocks(value uint64)
	// A property for the amount of used space, in bytes, in the volume.
	UsedBytes() uint64
	SetUsedBytes(value uint64)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSStatFSResult class.

Initializers

  • [IFSStatFSResult.InitWithCoder]
  • [IFSStatFSResult.InitWithFileSystemTypeName]: Creates an statistics result instance, using the given file system type name.

Instance Properties

  • [IFSStatFSResult.AvailableBlocks]: A property for the number of free blocks available to a non-superuser on the volume.
  • [IFSStatFSResult.SetAvailableBlocks]
  • [IFSStatFSResult.AvailableBytes]: A property for the amount of space available to users, in bytes, in the volume.
  • [IFSStatFSResult.SetAvailableBytes]
  • [IFSStatFSResult.BlockSize]: A property for the volume’s block size, in bytes.
  • [IFSStatFSResult.SetBlockSize]
  • [IFSStatFSResult.FileSystemSubType]: A property for the file system’s subtype or flavor.
  • [IFSStatFSResult.SetFileSystemSubType]
  • [IFSStatFSResult.FileSystemTypeName]: A property for the file system type name.
  • [IFSStatFSResult.FreeBlocks]: A property for the number of free blocks in the volume.
  • [IFSStatFSResult.SetFreeBlocks]
  • [IFSStatFSResult.FreeBytes]: A property for the amount of free space, in bytes, in the volume.
  • [IFSStatFSResult.SetFreeBytes]
  • [IFSStatFSResult.FreeFiles]: A property for the total number of free file slots in the volume.
  • [IFSStatFSResult.SetFreeFiles]
  • [IFSStatFSResult.IoSize]: A property for the optimal block size with which to perform I/O.
  • [IFSStatFSResult.SetIoSize]
  • [IFSStatFSResult.TotalBlocks]: A property for the volume’s total data block count.
  • [IFSStatFSResult.SetTotalBlocks]
  • [IFSStatFSResult.TotalBytes]: A property for the total size, in bytes, of the volume.
  • [IFSStatFSResult.SetTotalBytes]
  • [IFSStatFSResult.TotalFiles]: A property for the total number of file slots in the volume,
  • [IFSStatFSResult.SetTotalFiles]
  • [IFSStatFSResult.UsedBlocks]: A property for the number of used blocks in the volume.
  • [IFSStatFSResult.SetUsedBlocks]
  • [IFSStatFSResult.UsedBytes]: A property for the amount of used space, in bytes, in the volume.
  • [IFSStatFSResult.SetUsedBytes]

See: https://developer.apple.com/documentation/FSKit/FSStatFSResult

type IFSTask

type IFSTask interface {
	objectivec.IObject

	// Logs the given string to the initiating client.
	LogMessage(str string)

	// Informs the client that the task completed.
	DidCompleteWithError(error_ foundation.NSError)

	// A handler called by FSKit upon canceling the task.
	CancellationHandler() VoidHandler
	SetCancellationHandler(value VoidHandler)
}

An interface definition for the FSTask class.

Logging

  • [IFSTask.LogMessage]: Logs the given string to the initiating client.

Sending completion messages

  • [IFSTask.DidCompleteWithError]: Informs the client that the task completed.

Handling task cancellation

  • [IFSTask.CancellationHandler]: A handler called by FSKit upon canceling the task.
  • [IFSTask.SetCancellationHandler]

See: https://developer.apple.com/documentation/FSKit/FSTask

type IFSTaskOptions

type IFSTaskOptions interface {
	objectivec.IObject

	// An array of strings that represent command-line options for the task.
	TaskOptions() []string

	// Retrieves a URL for a given option.
	UrlForOption(option string) foundation.NSURL
}

An interface definition for the FSTaskOptions class.

Retrieving task options

  • [IFSTaskOptions.TaskOptions]: An array of strings that represent command-line options for the task.

Retrieving task option URLs

  • [IFSTaskOptions.UrlForOption]: Retrieves a URL for a given option.

See: https://developer.apple.com/documentation/FSKit/FSTaskOptions

type IFSUnaryFileSystem

type IFSUnaryFileSystem interface {
	objectivec.IObject
}

An interface definition for the FSUnaryFileSystem class.

See: https://developer.apple.com/documentation/FSKit/FSUnaryFileSystem

type IFSVolume

type IFSVolume interface {
	objectivec.IObject

	// Creates a volume with the given identifier and name.
	InitWithVolumeIDVolumeName(volumeID IFSVolumeIdentifier, volumeName IFSFileName) FSVolume

	// An identifier that uniquely identifies the volume.
	VolumeID() IFSVolumeIdentifier
	// The name of the volume.
	Name() IFSFileName
	SetName(value IFSFileName)
}

An interface definition for the FSVolume class.

Creating a volume

  • [IFSVolume.InitWithVolumeIDVolumeName]: Creates a volume with the given identifier and name.

Accessing volume properties

  • [IFSVolume.VolumeID]: An identifier that uniquely identifies the volume.
  • [IFSVolume.Name]: The name of the volume.
  • [IFSVolume.SetName]

See: https://developer.apple.com/documentation/FSKit/FSVolume

type IFSVolumeIdentifier

type IFSVolumeIdentifier interface {
	IFSEntityIdentifier
}

An interface definition for the FSVolumeIdentifier class.

See: https://developer.apple.com/documentation/FSKit/FSVolume/Identifier

type IFSVolumeSupportedCapabilities

type IFSVolumeSupportedCapabilities interface {
	objectivec.IObject

	// A Boolean property that indicates whether the volume supports persistent object identifiers and can look up file system objects by their IDs.
	SupportsPersistentObjectIDs() bool
	SetSupportsPersistentObjectIDs(value bool)
	// A Boolean property that indicates whether the volume supports 64-bit object IDs.
	Supports64BitObjectIDs() bool
	SetSupports64BitObjectIDs(value bool)
	// A Boolean property that indicates whether the volume supports document IDs for document revisions.
	SupportsDocumentID() bool
	SetSupportsDocumentID(value bool)

	// A Boolean property that indicates whether the volume supports symbolic links.
	SupportsSymbolicLinks() bool
	SetSupportsSymbolicLinks(value bool)
	// A Boolean property that indicates whether the volume supports hard links.
	SupportsHardLinks() bool
	SetSupportsHardLinks(value bool)

	// A Boolean property that indicates whether the volume supports a journal used to speed recovery in case of unplanned restart, such as a power outage or crash.
	SupportsJournal() bool
	SetSupportsJournal(value bool)
	// A Boolean property that indicates whether the volume currently uses a journal for speeding recovery after an unplanned shutdown.
	SupportsActiveJournal() bool
	SetSupportsActiveJournal(value bool)

	// A Boolan property that indicates the volume doesn’t store reliable times for the root directory.
	DoesNotSupportRootTimes() bool
	SetDoesNotSupportRootTimes(value bool)

	// A Boolean property that indicates whether the volume supports sparse files.
	SupportsSparseFiles() bool
	SetSupportsSparseFiles(value bool)
	// A Boolean property that indicates whether the volume supports zero runs
	SupportsZeroRuns() bool
	SetSupportsZeroRuns(value bool)
	// A Boolean property that indicates whether the volume supports fast results when fetching file system statistics.
	SupportsFastStatFS() bool
	SetSupportsFastStatFS(value bool)
	// A Boolean property that indicates whether the volume supports file sizes larger than 4GB, and potentially up to 2TB.
	Supports2TBFiles() bool
	SetSupports2TBFiles(value bool)
	// A Boolean property that indicates whether the volume supports open deny modes.
	SupportsOpenDenyModes() bool
	SetSupportsOpenDenyModes(value bool)
	// A Boolean property that indicates whether the volume supports hidden files.
	SupportsHiddenFiles() bool
	SetSupportsHiddenFiles(value bool)
	// A Boolean property that indicates the volume doesn’t support immutable files.
	DoesNotSupportImmutableFiles() bool
	SetDoesNotSupportImmutableFiles(value bool)
	// A Boolean property that indicates the volume doesn’t set file permissions.
	DoesNotSupportSettingFilePermissions() bool
	SetDoesNotSupportSettingFilePermissions(value bool)

	// A Boolean property that indicates whether the volume supports multiple logical file systems that share space in a single “partition.”
	SupportsSharedSpace() bool
	SetSupportsSharedSpace(value bool)
	// A Boolean property that indicates whether the volume supports volume groups.
	SupportsVolumeGroups() bool
	SetSupportsVolumeGroups(value bool)
	// A Boolean property that indicates the volume doesn’t support certain volume size reports.
	DoesNotSupportVolumeSizes() bool
	SetDoesNotSupportVolumeSizes(value bool)

	// A value that indicates the volume’s support for case sensitivity.
	CaseFormat() FSVolumeCaseFormat
	SetCaseFormat(value FSVolumeCaseFormat)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the FSVolumeSupportedCapabilities class.

Declaring identifier capabilities

  • [IFSVolumeSupportedCapabilities.SupportsPersistentObjectIDs]: A Boolean property that indicates whether the volume supports persistent object identifiers and can look up file system objects by their IDs.
  • [IFSVolumeSupportedCapabilities.SetSupportsPersistentObjectIDs]
  • [IFSVolumeSupportedCapabilities.Supports64BitObjectIDs]: A Boolean property that indicates whether the volume supports 64-bit object IDs.
  • [IFSVolumeSupportedCapabilities.SetSupports64BitObjectIDs]
  • [IFSVolumeSupportedCapabilities.SupportsDocumentID]: A Boolean property that indicates whether the volume supports document IDs for document revisions.
  • [IFSVolumeSupportedCapabilities.SetSupportsDocumentID]

Declaring linking capabilities

  • [IFSVolumeSupportedCapabilities.SupportsSymbolicLinks]: A Boolean property that indicates whether the volume supports symbolic links.
  • [IFSVolumeSupportedCapabilities.SetSupportsSymbolicLinks]
  • [IFSVolumeSupportedCapabilities.SupportsHardLinks]: A Boolean property that indicates whether the volume supports hard links.
  • [IFSVolumeSupportedCapabilities.SetSupportsHardLinks]

Declaring journaling capabilities

  • [IFSVolumeSupportedCapabilities.SupportsJournal]: A Boolean property that indicates whether the volume supports a journal used to speed recovery in case of unplanned restart, such as a power outage or crash.
  • [IFSVolumeSupportedCapabilities.SetSupportsJournal]
  • [IFSVolumeSupportedCapabilities.SupportsActiveJournal]: A Boolean property that indicates whether the volume currently uses a journal for speeding recovery after an unplanned shutdown.
  • [IFSVolumeSupportedCapabilities.SetSupportsActiveJournal]

Declaring root capabilites

  • [IFSVolumeSupportedCapabilities.DoesNotSupportRootTimes]: A Boolan property that indicates the volume doesn’t store reliable times for the root directory.
  • [IFSVolumeSupportedCapabilities.SetDoesNotSupportRootTimes]

Declaring file capabilities

  • [IFSVolumeSupportedCapabilities.SupportsSparseFiles]: A Boolean property that indicates whether the volume supports sparse files.
  • [IFSVolumeSupportedCapabilities.SetSupportsSparseFiles]
  • [IFSVolumeSupportedCapabilities.SupportsZeroRuns]: A Boolean property that indicates whether the volume supports zero runs
  • [IFSVolumeSupportedCapabilities.SetSupportsZeroRuns]
  • [IFSVolumeSupportedCapabilities.SupportsFastStatFS]: A Boolean property that indicates whether the volume supports fast results when fetching file system statistics.
  • [IFSVolumeSupportedCapabilities.SetSupportsFastStatFS]
  • [IFSVolumeSupportedCapabilities.Supports2TBFiles]: A Boolean property that indicates whether the volume supports file sizes larger than 4GB, and potentially up to 2TB.
  • [IFSVolumeSupportedCapabilities.SetSupports2TBFiles]
  • [IFSVolumeSupportedCapabilities.SupportsOpenDenyModes]: A Boolean property that indicates whether the volume supports open deny modes.
  • [IFSVolumeSupportedCapabilities.SetSupportsOpenDenyModes]
  • [IFSVolumeSupportedCapabilities.SupportsHiddenFiles]: A Boolean property that indicates whether the volume supports hidden files.
  • [IFSVolumeSupportedCapabilities.SetSupportsHiddenFiles]
  • [IFSVolumeSupportedCapabilities.DoesNotSupportImmutableFiles]: A Boolean property that indicates the volume doesn’t support immutable files.
  • [IFSVolumeSupportedCapabilities.SetDoesNotSupportImmutableFiles]
  • [IFSVolumeSupportedCapabilities.DoesNotSupportSettingFilePermissions]: A Boolean property that indicates the volume doesn’t set file permissions.
  • [IFSVolumeSupportedCapabilities.SetDoesNotSupportSettingFilePermissions]

Declaring volume capabilities

  • [IFSVolumeSupportedCapabilities.SupportsSharedSpace]: A Boolean property that indicates whether the volume supports multiple logical file systems that share space in a single “partition.”
  • [IFSVolumeSupportedCapabilities.SetSupportsSharedSpace]
  • [IFSVolumeSupportedCapabilities.SupportsVolumeGroups]: A Boolean property that indicates whether the volume supports volume groups.
  • [IFSVolumeSupportedCapabilities.SetSupportsVolumeGroups]
  • [IFSVolumeSupportedCapabilities.DoesNotSupportVolumeSizes]: A Boolean property that indicates the volume doesn’t support certain volume size reports.
  • [IFSVolumeSupportedCapabilities.SetDoesNotSupportVolumeSizes]

Working with case sensitivity

  • [IFSVolumeSupportedCapabilities.CaseFormat]: A value that indicates the volume’s support for case sensitivity.
  • [IFSVolumeSupportedCapabilities.SetCaseFormat]

See: https://developer.apple.com/documentation/FSKit/FSVolume/SupportedCapabilities

type VoidHandler

type VoidHandler = func()

VoidHandler handles A block or closure to indicate success or failure.

Used by:

  • [FSVolumeOperations.UnmountWithReplyHandler]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL