<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DiskImageKit",
  "identifier" : "/documentation/DiskImageKit/OpenConfigurationProtocol/open(url:mode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "DiskImageKit"
    ],
    "preciseIdentifier" : "s:12DiskImageKit25OpenConfigurationProtocolPA2A0dE0VRszrlE4open3url4modeAE10Foundation3URLV_AE4ModeOtFZ"
  },
  "title" : "open(url:mode:)"
}
-->

# open(url:mode:)

Returns a configuration to use for opening a disk image.

```
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

An [`OpenConfiguration`](/documentation/DiskImageKit/OpenConfiguration) instance.

## Discussion

The following example demonstrates how to open a disk image.

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)