MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / copy_file

Function copy_file

src/file_system.rs:123–128  ·  view source on GitHub ↗

Copies a file from source to destination, preserving file permissions.

(from: &Path, to: &Path)

Source from the content-addressed store, hash-verified

121
122/// Copies a file from source to destination, preserving file permissions.
123pub async fn copy_file(from: &Path, to: &Path) -> Result<()> {
124 tokio::fs::copy(from, to).await?;
125 let metadata = tokio::fs::metadata(from).await?;
126 tokio::fs::set_permissions(to, metadata.permissions()).await?;
127 Ok(())
128}
129
130#[cfg(test)]
131mod tests {

Callers 5

copy_lfs_objectsFunction · 0.85
copy_repoMethod · 0.85
copy_dirFunction · 0.85
test_copy_fileFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_copy_fileFunction · 0.68