deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

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

Open kinghat opened this issue 4 years ago • 2 comments

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/[email protected]/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.

kinghat avatar Jul 27 '21 20:07 kinghat

Deno.rename maps onto a posix system call. We want to maintain the ability to make this low-level call.

I think we should have the functionality you describe but it belongs in std/fs/move.ts

I will transfer this issue back to deno_std and retitle it.

ry avatar Jul 27 '21 22:07 ry

Are we okay with merging something that's not testable? I don't see how we could reasonably test moving accross mounts in CI.

lino-levan avatar Mar 14 '23 15:03 lino-levan