MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / copyFile

Function copyFile

src/controller/storage/storage.ts:369–389  ·  view source on GitHub ↗
(
  storageName: string,
  path: string,
  destStoragename: string,
  destPath: string,
  pathF2f: boolean = false
)

Source from the content-addressed store, hash-verified

367
368//copyFile
369async function copyFile(
370 storageName: string,
371 path: string,
372 destStoragename: string,
373 destPath: string,
374 pathF2f: boolean = false
375) {
376 //pathF2f:destPath为文件时需要设置为true。(默认false时为文件夹,文件名来自srcPath)
377 await rclone_api_post(
378 '/operations/copyfile',
379 {
380 srcFs: convertStoragePath(storageName, undefined, undefined, undefined, true),
381 srcRemote: convertStoragePath(storageName, path, undefined, true),
382 dstFs: convertStoragePath(destStoragename, undefined, undefined, undefined, true),
383 dstRemote:
384 convertStoragePath(destStoragename, destPath, !pathF2f, true)! +
385 (!pathF2f && getFileName(path)),
386 },
387 true
388 )
389}
390
391async function moveFile(
392 storageName: string,

Callers 2

ExplorerItemFunction · 0.90
executeTaskFunction · 0.90

Calls 3

rclone_api_postFunction · 0.90
convertStoragePathFunction · 0.85
getFileNameFunction · 0.85

Tested by

no test coverage detected