timkendrick/recursive-copy

Copied file handlers are not fully closed when returning results

Opened this issue · 0 comments

Steps to reproduce

  1. Copy the folder containing exe files by calling copy()
  2. Try to spawn the child process by passing the copied file path right after copy function returns

Expected behavior
Start the child process without an error

Actual behavior
Failed to start the child process with EBUSY error

Additional information
You can fix this issue by changing 'finish' event to 'close' event here

write.on('finish', function() {