Instance Method

update(fromPath:)

Updates the file wrapper to match a given file-system node.

Declaration

func update(fromPath path: String) -> Bool

Return Value

true if the update is carried out, false if it isn’t needed.

Discussion

For a directory file wrapper, the contained file wrappers are also sent update(fromPath:) messages. If nodes in the corresponding directory on the file system have been added or removed, corresponding file wrappers are released or created as needed.

Special Considerations

Beginning with OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of read(from:options:).

See Also

Updating File Wrappers

func needsToBeUpdated(fromPath: String)

Indicates whether the file wrapper needs to be updated to match a given file-system node.

Deprecated
func matchesContents(of: URL)

Indicates whether the contents of a file wrapper matches a directory, regular file, or symbolic link on disk.

func read(from: URL, options: FileWrapper.ReadingOptions = [])

Recursively rereads the entire contents of a file wrapper from the specified location on disk.