<!--
{
  "availability" : [
    "SwiftPM: 5.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Resource/copy(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription8ResourceV4copyyACSSFZ"
  },
  "title" : "copy(_:)"
}
-->

# copy(_:)

Applies the copy rule to a resource at the given path.

```
static func copy(_ path: String) -> Resource
```

## Parameters

`path`

The path for a resource.

## Return Value

A `Resource` instance.

## Discussion

If possible, use [`process(_:localization:)`](/documentation/PackageDescription/Resource/process(_:localization:)) and automatically
apply optimizations to resources.

If your resources must remain untouched or must retain a specific folder
structure, use the `copy` rule. It copies resources at the given `path`,
as is, to the top level in the package’s resource bundle. If the given
path represents a directory, Swift Package Manager preserves its structure.

---

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)