Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kinghat opened this issue Jul 27, 2021 · 2 comments
Open

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

kinghat opened this issue Jul 27, 2021 · 2 comments
Labels
suggestion a suggestion yet to be agreed

Comments

@kinghat
Copy link

kinghat commented Jul 27, 2021

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.

@kitsonk kitsonk transferred this issue from denoland/deno_std Jul 27, 2021
@ry
Copy link
Member

ry commented Jul 27, 2021

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 ry transferred this issue from denoland/deno Jul 27, 2021
@ry ry changed the title should Deno.rename handle moving across mounts/devices? std/fs/move should handle moving across mounts/devices Jul 27, 2021
@bartlomieju bartlomieju added the suggestion a suggestion yet to be agreed label Nov 10, 2021
@lino-levan
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion a suggestion yet to be agreed
Projects
None yet
Development

No branches or pull requests

4 participants