<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecCodeCopyPath(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecCodeCopyPath"
  },
  "title" : "SecCodeCopyPath(_:_:_:)"
}
-->

# SecCodeCopyPath(_:_:_:)

Retrieves the location on disk of signed code, given a code or static code object.

```
func SecCodeCopyPath(_ staticCode: SecStaticCode, _ flags: SecCSFlags, _ path: UnsafeMutablePointer<CFURL?>) -> OSStatus
```

## Parameters

`staticCode`

The code or static code object whose code you wish to locate. If you provide a code object, the function processes it in the same manner as the  [`SecCodeCopyStaticCode(_:_:_:)`](/documentation/Security/SecCodeCopyStaticCode(_:_:_:)) function.

`flags`

Optional flags; see [`SecCSFlags`](/documentation/Security/SecCSFlags) for possible values. Pass [`kSecCSDefaultFlags`](/documentation/Security/SecCSFlags/kSecCSDefaultFlags) for standard behavior.

`path`

On return, provides a URL identifying the location on disk of the code or static code object. For single files, the URL points to the file. For bundles, it points to the directory containing the entire bundle. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to release this object when you are finished with it.

## Return Value

A result code. See [Code Signing Services Result Codes](/documentation/Security/code-signing-services-result-codes).

## See Also

[`SecCodeCopySigningInformation(_:_:_:)`](/documentation/Security/SecCodeCopySigningInformation(_:_:_:))

Retrieves various pieces of information from a code signature.



---

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)