---
title: keepBackupFile
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsdocument/keepbackupfile
---

# keepBackupFile

A Boolean value that indicates whether the document archives previously saved versions of the document.

## Declaration

```swift
nonisolated var keepBackupFile: Bool { get }
```

## Discussion

Discussion The default value of this property is false, which causes each new save operation to replace the document’s on-disk content. If you override this method and return true, a save operation saves the document’s previous contents in a backup file before saving the current contents.

## See Also

### Getting Document Metadata

- [fileURL](appkit/nsdocument/fileurl.md)
- [isEntireFileLoaded](appkit/nsdocument/isentirefileloaded.md)
- [fileModificationDate](appkit/nsdocument/filemodificationdate.md)
- [isDraft](appkit/nsdocument/isdraft.md)
- [fileType](appkit/nsdocument/filetype.md)
- [isDocumentEdited](appkit/nsdocument/isdocumentedited.md)
- [isInViewingMode](appkit/nsdocument/isinviewingmode.md)
