node-fs-extra icon indicating copy to clipboard operation
node-fs-extra copied to clipboard

copy: support mode for copyFile

Open rickycao-qy opened this issue 3 years ago • 5 comments

This PR is to support reflink when copying files.

rickycao-qy avatar Dec 04 '20 09:12 rickycao-qy

mode is only supported by Node 14+; and some of the options here overlap with some of our existing options. Long-term, I think moving to an API closer to copyFile makes sense, but I'm not sure if now is the right time. @manidlou thoughts?

RyanZim avatar Dec 05 '20 15:12 RyanZim

mode is only supported by Node 14+; and some of the options here overlap with some of our existing options. Long-term, I think moving to an API closer to copyFile makes sense, but I'm not sure if now is the right time. @manidlou thoughts?

Node.js with older version has the optional parameter flag which specifies modifiers for the copy operation. Can we just make this uniform in copy API

rickycao-qy avatar Dec 10 '20 10:12 rickycao-qy

@manidlou @RyanZim Could you have a look, please

rickycao-qy avatar Dec 22 '20 04:12 rickycao-qy

Sorry for late reply! I also agree that it is generally a good idea to be as compatible as possible with node core!

So, this option only applies to copying files, however fs-extra tries to abstract away the difficulties of differences between files and dirs for the end user.

IMHO, @rickycao-qy we need to come up with a better name than mode for this option since it is not descriptive enough to let our users know this option is only used for copying files.

Hey, thanks for the reply. Personally I think this option is useful to copy dirs as we just apply this option to recursively copy files in dirs when applying to dirs. Or we can use a more descriptive option such as copyFileMode?

rickycao-qy avatar Jan 26 '21 14:01 rickycao-qy

I am ok with copyFileMode.

manidlou avatar Feb 15 '21 02:02 manidlou

Closing as this is stale.

RyanZim avatar Feb 10 '24 18:02 RyanZim