Contents

init(opening:)

Opens an existing disk image using the specified image URL.

Declaration

convenience init(opening configuration: some OpenConfigurationProtocol) throws

Parameters

  • configuration:

    The configuration object that specifies the parameters for opening the disk image.

Discussion

Use this initializer to open any existing disk image — standalone or a disk image layer. To append this image to a stacked disk image, use appending(_:). Encrypted disk images are not supported.

The following example demonstrates opening a disk image using a URL.

let image = try DiskImage(opening: .open(url: imageURL))