---
title: "CFStringCreateWithFileSystemRepresentation(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstringcreatewithfilesystemrepresentation(_:_:)"
---

# CFStringCreateWithFileSystemRepresentation(_:_:)

Creates a CFString from a zero-terminated POSIX file system representation.

## Declaration

```swift
func CFStringCreateWithFileSystemRepresentation(_ alloc: CFAllocator!, _ buffer: UnsafePointer<CChar>!) -> CFString!
```

## Parameters

- `alloc`: The allocator to use to allocate memory for the new string. Pass NULL or doc://com.apple.corefoundation/documentation/CoreFoundation/kCFAllocatorDefault to use the current default allocator.
- `buffer`: The C string that you want to convert.

## Return Value

Return Value A string that represents buffer. The result is NULL if there was a problem in creating the string (possible if the conversion fails due to bytes in the buffer not being a valid sequence of bytes for the appropriate character encoding). Ownership follows the The Create Rule.

## See Also

### String File System Representations

- [CFStringGetFileSystemRepresentation(_:_:_:)](corefoundation/cfstringgetfilesystemrepresentation(_:_:_:).md)
- [CFStringGetMaximumSizeOfFileSystemRepresentation(_:)](corefoundation/cfstringgetmaximumsizeoffilesystemrepresentation(_:).md)
