---
title: completeFileProtectionUnlessOpen
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsdata/writingoptions/completefileprotectionunlessopen
---

# completeFileProtectionUnlessOpen

An option to allow the file to be accessible while the device is unlocked or the file is already open.

## Declaration

```swift
static var completeFileProtectionUnlessOpen: NSData.WritingOptions { get }
```

## Discussion

Discussion In this case, your app cannot open the file to read it or write to it when the device is locked, but your app can create new files with this class. If one of these files is open when the device is locked, your app can read and write to the opened file.

## See Also

### Constants

- [atomic](foundation/nsdata/writingoptions/atomic.md)
- [withoutOverwriting](foundation/nsdata/writingoptions/withoutoverwriting.md)
- [noFileProtection](foundation/nsdata/writingoptions/nofileprotection.md)
- [completeFileProtection](foundation/nsdata/writingoptions/completefileprotection.md)
- [completeFileProtectionUntilFirstUserAuthentication](foundation/nsdata/writingoptions/completefileprotectionuntilfirstuserauthentication.md)
- [fileProtectionMask](foundation/nsdata/writingoptions/fileprotectionmask.md)
- [completeFileProtectionWhenUserInactive](foundation/nsdata/writingoptions/completefileprotectionwhenuserinactive.md)
