denoland / denoland/std

std/fs/move should handle moving across mounts/devices

Open
#1,070 2 comments 1 reaction 0 assignees View on GitHub
fs suggestion
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

currently you cannot use `Deno.rename` to `move` a file or directory across mounts/devices:
> error: Uncaught (in promise) Error: Invalid cross-device link (os error 18)
await Deno.rename(src, dest);
^
at deno:core/01_core.js:106:46
at unwrapOpResult (deno:core/01_core.js:126:13)
at async Object.rename (deno:runtime/js/30_fs.js:172:5)
at async move (https://deno.land/std@0.102.0/fs/move.ts:33:3)

this is not the case with the `mv` command: `mv uses cp(1) and rm(1)`

**Describe the solution you'd like**

make Deno.rename match `mv`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.