---
title: "open(url:mode:)"
framework: diskimagekit
role: symbol
role_heading: Type Method
path: "diskimagekit/openconfigurationprotocol/open(url:mode:)"
---

# open(url:mode:)

Returns a configuration to use for opening a disk image.

## Declaration

```swift
static func open(url: URL, mode: OpenConfiguration.Mode = .automatic) -> Self
```

## Parameters

- `url`: A doc://com.apple.documentation/documentation/Foundation/URL of the disk image file to open.
- `mode`: Mode in which to open the image (read-only or read-write).

## Return Value

Return Value An OpenConfiguration instance.

## Discussion

Discussion The following example demonstrates how to open a disk image. let image = try DiskImage(opening: .open(url: imageURL))
