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
copy*(): fix copying bind-mounted directories #618
Conversation
These tests that are failing are not related to these changes and are from |
Cool It is fixed now! 😁 |
Just some thoughts: Might it be necessary to check up the whole dest path? For example, in the case of:
fs.copy('src', 'dest/sub1/sub2', cb) If so, perhaps the stats / inode information can be cached, to prevent having to re-fetch this information every time a dir in src is copied. Or, perhaps this check only needs to be made for the main src and dest, and not again inside |
@rossj that's a good point! I actually had that in mind when I started working on it, but somehow slipped through the cracks! I'd say we probably need to check only the main src and dest. |
@manidlou ping? |
@RyanZim thanks for pinging! I'll try to finish it this weekend. |
90a762f
to
60e0210
Compare
It is ready to be reviewed! @jprichardson @RyanZim @JPeer264 @rossj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
@jprichardson @JPeer264 do you have any concerns about this?! Because I have the |
Nice work @manidlou! |
* copy*(): fix copying bind-mounted dirs * copy*(): fix case-insensitive-paths tests * copy*(): refactor to check paths more efficiently * destructure stats object after checking err
* copy*(): fix copying bind-mounted dirs * copy*(): fix case-insensitive-paths tests * copy*(): refactor to check paths more efficiently * destructure stats object after checking err
* Remove secure-random from dev-deps (#610) * fix ensureDir() doc * moveSync: refactor to use renameSync * copy*(): fix copying bind-mounted directories (#618) * copy*(): fix copying bind-mounted dirs * copy*(): fix case-insensitive-paths tests * copy*(): refactor to check paths more efficiently * destructure stats object after checking err * move*(): check paths before moving * move*(): add case-insensitive paths test * remove unnecessary done callback from test * copy*(): add new option checkPathsBeforeCopying * update copy*() docs to include checkPathsBeforeCopying * some reformatting * copy*(): use fs.stat with bigint option * move*(): refactor to use the internal stat functions * move*(): add test for prevent moving identical * disable graceful-fs in copy and move tests * fix parsing node version * tiny reformat * update copy*() docs * refactor parsing node version * use semver to parse node version in tests
fix #613.
Fixed the issue of infinite loop that would used to happen for cases like bind-mounted directories with subdirectory that would end up creating a lot of recursive same subdirectories and finally failing with
ENAMETOOLONG
error.With this fix, we catch these weird cases and throw error with descriptive message.
Also, cleaned up some tests.