---
title: fileSystemRepresentation
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsstring/filesystemrepresentation
---

# fileSystemRepresentation

A file system-specific representation of the receiver.

## Declaration

```swift
var fileSystemRepresentation: UnsafePointer<CChar> { get }
```

## Discussion

Discussion The returned C string will be automatically freed just as a returned object would be released; your code should copy the representation or use getFileSystemRepresentation(_:maxLength:) if it needs to store the representation outside of the memory context in which the representation was created. Raises an characterConversionException if the receiver can’t be represented in the file system’s encoding. It also raises an exception if the receiver contains no characters. Note that this method only works with file paths (not, for example, string representations of URLs). To convert a char * path (such as you might get from a C library routine) to an NSString object, use the string(withFileSystemRepresentation:length:) method on FileManager.

## See Also

### Working with Paths

- [path(withComponents:)](foundation/nsstring/path(withcomponents:).md)
- [pathComponents](foundation/nsstring/pathcomponents.md)
- [completePath(into:caseSensitive:matchesInto:filterTypes:)](foundation/nsstring/completepath(into:casesensitive:matchesinto:filtertypes:).md)
- [getFileSystemRepresentation(_:maxLength:)](foundation/nsstring/getfilesystemrepresentation(_:maxlength:).md)
- [isAbsolutePath](foundation/nsstring/isabsolutepath.md)
- [lastPathComponent](foundation/nsstring/lastpathcomponent.md)
- [pathExtension](foundation/nsstring/pathextension.md)
- [abbreviatingWithTildeInPath](foundation/nsstring/abbreviatingwithtildeinpath.md)
- [appendingPathComponent(_:)](foundation/nsstring/appendingpathcomponent(_:).md)
- [appendingPathExtension(_:)](foundation/nsstring/appendingpathextension(_:).md)
- [deletingLastPathComponent](foundation/nsstring/deletinglastpathcomponent.md)
- [deletingPathExtension](foundation/nsstring/deletingpathextension.md)
- [expandingTildeInPath](foundation/nsstring/expandingtildeinpath.md)
- [resolvingSymlinksInPath](foundation/nsstring/resolvingsymlinksinpath.md)
- [standardizingPath](foundation/nsstring/standardizingpath.md)
