---
title: "init(opening:)"
framework: diskimagekit
role: symbol
role_heading: Initializer
path: "diskimagekit/diskimage/init(opening:)"
---

# init(opening:)

Opens an existing disk image using the specified image URL.

## Declaration

```swift
convenience init(opening configuration: some OpenConfigurationProtocol) throws
```

## Parameters

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

## Discussion

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)) note: CorruptedImageError if the disk image contains invalid data. UnsupportedFormatError if the disk image format isn’t supported. POSIXError for file system errors such as file not found or permission denied.
