---
title: "copyRemoteFile(_:toLocalPath:)"
framework: IOBluetooth
role: symbol
role_heading: Instance Method
path: "iobluetooth/obexfiletransferservices/copyremotefile(_:tolocalpath:)"
---

# copyRemoteFile(_:toLocalPath:)

Copy a remote file to a local path

## Declaration

```swift
func copyRemoteFile(_ inRemoteFileName: String!, toLocalPath inLocalPathAndName: String!) -> OBEXError
```

## Parameters

- `inRemoteFileName`: The name of the remote file to get
- `inLocalPathAndName`: The path and name of where the received file will go

## Return Value

Return Value kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError. initially. Further results returned through the fileTransferServicesGetComplete: and fileTransferServicesGetProgress: delegate methods if initially successful.

## Discussion

Discussion Equivalent to ‘cp remotePath/remoteFileName localPathAndName’.
