---
title: "init(fileURLWithFileSystemRepresentation:isDirectory:relativeTo:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/url/init(fileurlwithfilesystemrepresentation:isdirectory:relativeto:)"
---

# init(fileURLWithFileSystemRepresentation:isDirectory:relativeTo:)

Creates a file URL that references the local file or directory for the file system representation of the path.

## Declaration

```swift
init(fileURLWithFileSystemRepresentation path: UnsafePointer<Int8>, isDirectory: Bool, relativeTo base: URL?)
```

## Parameters

- `path`: The location in the file system.
- `isDirectory`: A Boolean value that indicates whether the location is a directory.

## Discussion

Discussion File system representation is a null-terminated C string with canonical UTF-8 encoding.

## See Also

### Creating a file URL from a string path

- [init(filePath:directoryHint:relativeTo:)](foundation/url/init(filepath:directoryhint:relativeto:).md)
- [URL.DirectoryHint](foundation/url/directoryhint.md)
- [init(fileURLWithPath:)](foundation/url/init(fileurlwithpath:).md)
- [init(fileURLWithPath:isDirectory:)](foundation/url/init(fileurlwithpath:isdirectory:).md)
- [init(fileURLWithPath:relativeTo:)](foundation/url/init(fileurlwithpath:relativeto:).md)
- [init(fileURLWithPath:isDirectory:relativeTo:)](foundation/url/init(fileurlwithpath:isdirectory:relativeto:).md)
- [init(fileReferenceLiteralResourceName:)](foundation/url/init(filereferenceliteralresourcename:).md)
- [init(filePath:directoryHint:)](foundation/url/init(filepath:directoryhint:).md)
