DiskUsage

public class DiskUsage

Entrypoint for accessing information about the amount of disk storage used by Ditto. This class can’t be instantiated. You can access an instance through the ditto.diskUsage API.

Properties

  • Returns a single DiskUsageItem representing a tree of directories with file size information. Use the observe() method to access the same information with callbacks as the size of files change over time.

    Declaration

    Swift

    public var exec: DiskUsageItem { get }

    Return Value

    DiskUsageItem

Observing

  • Starts filesystem observation. Disk usage details will be passed to the given closure as files in the Ditto directory change size over time.

    Declaration

    Swift

    public func observe(eventHandler: @escaping (DiskUsageItem) -> Void) -> DiskUsageObserverHandle

    Parameters

    eventHandler

    A closure that will be invoked regularly with DiskUsageItem instances.

    Return Value

    A DiskUsageObserverHandle which should be held in scope to continue observation. Invoke the stop() method on the handle to terminate callbacks.

  • A handle used to control disk usage observation.

    See more

    Declaration

    Swift

    public class DiskUsageObserverHandle

Publisher

Extension Method