<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURL/getFileSystemRepresentation(_:maxLength:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURL(im)getFileSystemRepresentation:maxLength:"
  },
  "title" : "getFileSystemRepresentation(_:maxLength:)"
}
-->

# getFileSystemRepresentation(_:maxLength:)

Fills the provided buffer with a C string representing a local file system path.

```
func getFileSystemRepresentation(_ buffer: UnsafeMutablePointer<CChar>, maxLength maxBufferLength: Int) -> Bool
```

## Parameters

`buffer`

A buffer large enough to hold the path. On return, contains a null-terminated C string in file system representation.

`maxBufferLength`

The size of `buffer` in bytes (typically `MAXPATHLEN` or `PATH_MAX`).

## Return Value

Returns <doc://com.apple.documentation/documentation/Swift/true> if the URL could be converted into a file system representation, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The file system representation format is described in File Encodings and Fonts.

---

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)