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

# init(_:)

Creates a file URL that references the local file or directory at the file path you specify.

## Declaration

```swift
init?(_ path: FilePath)
```

## Parameters

- `path`: The location in the file system.

## Discussion

Discussion This method may perform file system I/O to determine if the path is to a directory. If you know the path is to a directory, use init(_:isDirectory:) to avoid the file system I/O.

## See Also

### Creating a file URL from a file path

- [init(_:isDirectory:)](foundation/url/init(_:isdirectory:).md)
- [FilePath](system/filepath.md)
