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

fs: fs.cp() should accept mode flag to specify the copy behavior #47084

Merged

Commits on Apr 14, 2023

  1. fs: add support for mode flag to specify the copy behavior

    `fs.copyFile()` supports copy-on-write operation
    if the underlying platform supports it by passing a mode flag.
    This behavior was added in
    nodejs@a16d88d.
    
    This patch adds `mode` flag to `fs.cp()`, `fs.cpSync()`,
    and `fsPromises.cp()` to allow to change their behaviors
    to copy files.
    
    This test case is based on the test case that was introduced
    when we add `fs.constants.COPYFILE_FICLONE`.
    nodejs@a16d88d.
    
    This test strategy is:
    
    - If the platform supports copy-on-write operation,
      check whether the destination is expected
    - Otherwise, the operation will fail
      and check whether the failure error information is expected.
    
    Fixes: nodejs#47080
    tetsuharuohzeki committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    52038c0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6a2b4bc View commit details
    Browse the repository at this point in the history