Instance Property


A file system-specific representation of the receiver.


var fileSystemRepresentation: UnsafePointer<Int8> { get }


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.