# Interface: CommitCopyFile

Server-side copy of a file from a source repo/bucket to the destination repo.

Only supported when the destination repo is a bucket. The source file must be xet-backed,
so the caller is responsible for resolving the source path to its [sourceXetHash](CommitCopyFile#sourcexethash)
(typically via [pathsInfo](../modules#pathsinfo) or [listFiles](../modules#listfiles)).

For higher-level helpers that perform the resolution and handle non-xet source files,
see [copyFile](../modules#copyfile), [copyFiles](../modules#copyfiles) and [copyFolder](../modules#copyfolder).

## Properties

### mode

• `Optional` **mode**: `number`

POSIX file mode (st_mode), e.g. `0o755`, optionally with file type bits `0o100000` (regular file)
or `0o120000` (symlink, content is the link target).

Only supported for buckets, ignored otherwise. When omitted, the file has no mode on the Hub.

#### Defined in[[mode.defined-in]]

[packages/hub/src/lib/commit.ts:142](https://github.com/huggingface/huggingface.js/blob/main/packages/hub/src/lib/commit.ts#L142)

___

### operation

• **operation**: ``"copy"``

#### Defined in[[operation.defined-in]]

[packages/hub/src/lib/commit.ts:132](https://github.com/huggingface/huggingface.js/blob/main/packages/hub/src/lib/commit.ts#L132)

___

### path

• **path**: `string`

#### Defined in[[path.defined-in]]

[packages/hub/src/lib/commit.ts:133](https://github.com/huggingface/huggingface.js/blob/main/packages/hub/src/lib/commit.ts#L133)

___

### sourceRepo

• **sourceRepo**: [`RepoDesignation`](../modules#repodesignation)

#### Defined in[[sourcerepo.defined-in]]

[packages/hub/src/lib/commit.ts:135](https://github.com/huggingface/huggingface.js/blob/main/packages/hub/src/lib/commit.ts#L135)

___

### sourceXetHash

• **sourceXetHash**: `string`

#### Defined in[[sourcexethash.defined-in]]

[packages/hub/src/lib/commit.ts:134](https://github.com/huggingface/huggingface.js/blob/main/packages/hub/src/lib/commit.ts#L134)

