<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URL/init(fileURLWithFileSystemRepresentation:isDirectory:relativeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation3URLV35fileURLWithFileSystemRepresentation11isDirectory10relativeToACSPys4Int8VG_SbACSghtcfc"
  },
  "title" : "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.

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)