init(creating:)
Creates a new, empty disk image.
Declaration
convenience init(creating configuration: some DiskImage.CreationConfiguration) throwsParameters
- configuration:
A configuration object that specifies the parameters for the new disk image. If the URL points to an existing file, the framework overwrites it.
Discussion
Use this initializer to create a new standalone disk image or a base image for a stacked disk image. The configuration must not be a DiskImage.StackableLayer; use appending(_:) instead.
The following example creates an ASIF disk image at a specific location, a block count, and block size you specify with an ASIFCreationConfiguration configuration object.
let image = try DiskImage(creating: .asif(url: imageURL, blockCount: 1000000000, blockSize: .bytes512))