---
title: "getFileSystemRepresentation(_:maxLength:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsurl/getfilesystemrepresentation(_:maxlength:)"
---

# getFileSystemRepresentation(_:maxLength:)

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

## Declaration

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

Return Value Returns true if the URL could be converted into a file system representation, otherwise false.

## Discussion

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

## See Also

### Creating a URL object

- [init(string:)](foundation/nsurl/init(string:).md)
- [init(string:encodingInvalidCharacters:)](foundation/nsurl/init(string:encodinginvalidcharacters:).md)
- [init(string:relativeTo:)](foundation/nsurl/init(string:relativeto:).md)
- [fileURL(withPath:isDirectory:)](foundation/nsurl/fileurl(withpath:isdirectory:).md)
- [init(fileURLWithPath:isDirectory:)](foundation/nsurl/init(fileurlwithpath:isdirectory:).md)
- [fileURL(withPath:relativeTo:)](foundation/nsurl/fileurl(withpath:relativeto:).md)
- [init(fileURLWithPath:relativeTo:)](foundation/nsurl/init(fileurlwithpath:relativeto:).md)
- [fileURL(withPath:isDirectory:relativeTo:)](foundation/nsurl/fileurl(withpath:isdirectory:relativeto:).md)
- [init(fileURLWithPath:isDirectory:relativeTo:)](foundation/nsurl/init(fileurlwithpath:isdirectory:relativeto:).md)
- [fileURL(withPath:)](foundation/nsurl/fileurl(withpath:).md)
- [init(fileURLWithPath:)](foundation/nsurl/init(fileurlwithpath:).md)
- [fileURL(withPathComponents:)](foundation/nsurl/fileurl(withpathcomponents:).md)
- [init(resolvingAliasFileAt:options:)](foundation/nsurl/init(resolvingaliasfileat:options:).md)
- [init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)](foundation/nsurl/init(resolvingbookmarkdata:options:relativeto:bookmarkdataisstale:).md)
- [fileURL(withFileSystemRepresentation:isDirectory:relativeTo:)](foundation/nsurl/fileurl(withfilesystemrepresentation:isdirectory:relativeto:).md)
