<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringGetMaximumSizeOfFileSystemRepresentation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFStringGetMaximumSizeOfFileSystemRepresentation"
  },
  "title" : "CFStringGetMaximumSizeOfFileSystemRepresentation(_:)"
}
-->

# CFStringGetMaximumSizeOfFileSystemRepresentation(_:)

Determines the upper bound on the number of bytes required to hold the file system representation of the string.

```
func CFStringGetMaximumSizeOfFileSystemRepresentation(_ string: CFString!) -> CFIndex
```

## Parameters

`string`

The string to convert.

## Return Value

The upper bound on the number of bytes required to hold the file system representation of the string.

## Discussion

The result is returned quickly as a rough approximation, and could be much larger than the actual space required. The result includes space for the zero termination. If you are allocating a buffer for long-term storage, you should reallocate it to be the right size after calling [`CFStringGetFileSystemRepresentation(_:_:_:)`](/documentation/CoreFoundation/CFStringGetFileSystemRepresentation(_:_:_:)).

---

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)