<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSData/WritingOptions/withoutOverwriting",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSDataWritingOptions@NSDataWritingWithoutOverwriting"
  },
  "title" : "withoutOverwriting"
}
-->

# withoutOverwriting

An option that attempts to write data to a file and fails with an error if the destination file already exists.

```
static var withoutOverwriting: NSData.WritingOptions { get }
```

## Discussion

You can’t combine this constant with [`atomic`](/documentation/Foundation/NSData/WritingOptions/atomic) because atomic allows the system to overwrite the original file.

---

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)