timkendrick / recursive-copy

Simple, flexible file copy utility
96 stars 18 forks source link

Copied file handlers are not fully closed when returning results #38

Open eunjungoh35 opened 1 year ago

eunjungoh35 commented 1 year ago

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 https://github.com/timkendrick/recursive-copy/blob/4c9a8b8a4bf573285e9c4a649a30a2b59ccf441c/lib/copy.js#L338