# FileOperation

Calling this method performs a file operation, by either copying or moving files.

### **Method Name:**

FileOperation

### **Payload:**

The direct command requires the following properties:

* **SourceContainerName**: The name of the Source Container
* **SourceFolder**: Optional: Specify if only files in a folder should be copied. Must be on the form "myfolder/myfolder2"
* **SourceFilePatterns**: Optional: FileSystemGlobbing pattern, use if only files matching a pattern should be copied. Seperate using ";;", eg. "batched/*;;logs/*".
* **DestinationContainerName**: The name of the Destination Container. When files are copied they will retain the same folder hierarchy as the source container, as well as the same filenames.
* **FileOperation**: Set to either Copy or Move. If Move is selected, files in the SourceContainer will be deleted after they have been copied.

Here is an example of a file operation payload:

```
{
    "sourceContainerName": "SourceContainer",
    "sourceFolder": "SourceFolder",
    "sourceFilePatterns": "batched/*;;logs/*",
    "destinationContainerName": "DestContainer",
    "fileOperation": "Move",
}
```

### **Return value**

The direct command returns an OperationResult that indicates either success or failure.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tricloudnexus.io/edge/nexus-modules/data-connector-modules/filetransfermodule/direct-commands/fileoperation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
