Initializer

init(url:options:)

Initializes a file wrapper instance whose kind is determined by the type of file-system node located by the URL.

Declaration

init(url: URL, options: FileWrapper.ReadingOptions = []) throws

Parameters

url

URL of the file-system node the file wrapper is to represent.

options

Option flags for reading the node located at url. See FileWrapper.ReadingOptions for possible values.

outError

If an error occurs, upon return contains an NSError object that describes the problem. Pass NULL if you do not want error information.

Return Value

File wrapper for the file-system node at url. May be a directory, file, or symbolic link, depending on what is located at the URL. Returns false (0) if reading is not successful.

Discussion

If url is a directory, this method recursively creates file wrappers for each node within that directory. Use the fileWrappers property to get the file wrappers of the nodes contained by the directory.

See Also

Creating File Wrappers

init?(path: String)

Initializes a file wrapper instance whose kind is determined by the type of file-system node located by the path.

Deprecated
init(directoryWithFileWrappers: [String : FileWrapper])

Initializes the receiver as a directory file wrapper, with a given file-wrapper list.

init(regularFileWithContents: Data)

Initializes the receiver as a regular-file file wrapper.

init(symbolicLinkWithDestination: String)

Initializes the receiver as a symbolic-link file wrapper.

Deprecated
init(symbolicLinkWithDestinationURL: URL)

Initializes the receiver as a symbolic-link file wrapper that links to a specified file.

init?(serializedRepresentation: Data)

Initializes the receiver as a regular-file file wrapper from given serialized data.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software