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

# CFURLCopyFileSystemPath(_:_:)

Returns the path portion of a given URL.

```
func CFURLCopyFileSystemPath(_ anURL: CFURL!, _ pathStyle: CFURLPathStyle) -> CFString!
```

## Parameters

`anURL`

The `CFURL` object whose path you want to obtain.

`pathStyle`

The operating system path style to be used to create the path. See [`CFURLPathStyle`](/documentation/CoreFoundation/CFURLPathStyle) for a list of possible values.

## Return Value

The URL’s path in the format specified by `pathStyle`. Ownership follows the create rule. See [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

## Discussion

This function returns the URL’s path as a file system path for a given path style.

---

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)