---
title: "read(from:options:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filewrapper/read(from:options:)"
---

# read(from:options:)

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

## Declaration

```swift
func read(from url: URL, options: FileWrapper.ReadingOptions = []) throws
```

## Parameters

- `url`: URL of the file-system node corresponding to the file wrapper.
- `options`: Option flags for reading the node located at url. See doc://com.apple.foundation/documentation/Foundation/FileWrapper/ReadingOptions for possible values.

## Discussion

Discussion When reading a directory, children are added and removed as necessary to match the file system. note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Related Documentation

- [fileWrappers](foundation/filewrapper/filewrappers.md)
- [init(url:options:)](foundation/filewrapper/init(url:options:)-70161.md)
- [filename](foundation/filewrapper/filename.md)
- [fileAttributes](foundation/filewrapper/fileattributes.md)
- [write(to:options:originalContentsURL:)](foundation/filewrapper/write(to:options:originalcontentsurl:).md)

### Updating File Wrappers

- [needsToBeUpdated(fromPath:)](foundation/filewrapper/needstobeupdated(frompath:).md)
- [matchesContents(of:)](foundation/filewrapper/matchescontents(of:).md)
- [update(fromPath:)](foundation/filewrapper/update(frompath:).md)
