files.copy

API: Experimental/Beta Auth: Users

Copies a file from one path to another

Request Response Error
BulkRequest<FilesCopyRequestItem> BulkResponse<LongRunningTask> CommonErrorMessage

The file can be of any type. If a directory is chosen then this will recursively copy all of its children. This request might fail half-way through. This can potentially lead to a situation where a partial file is left on the file-system. It is left to the user to clean up this file.

This operation handles conflicts depending on the supplied WriteConflictPolicy.

This is a long running task. As a result, this operation might respond with a status code which indicate that it will continue in the background. Progress of this job can be followed using the task API.

UCloud applied metadata will not be copied to the new file. File-system metadata (e.g. extended-attributes) may be moved, however this is provider dependant.

Errors:

Status Code Description
HttpStatusCode(value=400, description=Bad Request) The operation couldn't be completed because of the write conflict policy
HttpStatusCode(value=404, description=Not Found) Either the oldPath or newPath exists or you lack permissions
HttpStatusCode(value=403, description=Forbidden) You lack permissions to perform this operation

Examples:

Example
Example of duplicating a file