node-fs-extra
node-fs-extra copied to clipboard
copy: support mode for copyFile
This PR is to support reflink when copying files.
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?
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 tocopyFile
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
@manidlou @RyanZim Could you have a look, please
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
?
I am ok with copyFileMode
.
Closing as this is stale.