write(to:options:originalContentsURL:)
Recursively writes the entire contents of a file wrapper to a given file-system URL.
Declaration
func write(to url: URL, options: FileWrapper.WritingOptions = [], originalContentsURL: URL?) throwsParameters
- url:
URL of the file-system node to which the file wrapper’s contents are written.
- options:
Option flags for writing to the node located at
url. See Writingoptions for possible values. - originalContentsURL:
The location of a previous revision of the contents being written. The default implementation of this method attempts to avoid unnecessary I/O by writing hard links to regular files instead of actually writing out their contents when the contents have not changed. The child file wrappers must return accurate values when its Filename property is accessed for this to work. Use the
NSFileWrapperWritingWithNameUpdatingwriting option to increase the likelihood of that.Specify
nilfor this parameter if there is no earlier version of the contents or if you want to ensure that all the contents are written to files.