---
title: "init(path:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/filewrapper/init(path:)"
---

# init(path:)

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

## Declaration

```swift
convenience init?(path: String)
```

## Parameters

- `path`: Pathname of the file-system node the file wrapper is to represent.

## Return Value

Return Value File wrapper for node.

## Discussion

Discussion If node is a directory, this method recursively creates file wrappers for each node within that directory. 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 init(url:options:).

## See Also

### Related Documentation

- [preferredFilename](foundation/filewrapper/preferredfilename.md)
- [filename](foundation/filewrapper/filename.md)
- [fileAttributes](foundation/filewrapper/fileattributes.md)

### Creating File Wrappers

- [init(url:options:)](foundation/filewrapper/init(url:options:)-70161.md)
- [init(directoryWithFileWrappers:)](foundation/filewrapper/init(directorywithfilewrappers:).md)
- [init(regularFileWithContents:)](foundation/filewrapper/init(regularfilewithcontents:).md)
- [init(symbolicLinkWithDestination:)](foundation/filewrapper/init(symboliclinkwithdestination:).md)
- [init(symbolicLinkWithDestinationURL:)](foundation/filewrapper/init(symboliclinkwithdestinationurl:).md)
- [init(serializedRepresentation:)](foundation/filewrapper/init(serializedrepresentation:).md)
