Svetlitski / fcp

A significantly faster alternative to the classic Unix cp(1) command, copying large files and directories in a fraction of the time.
BSD 3-Clause "New" or "Revised" License
734 stars 17 forks source link

Add meta device with inode in self copy check #30

Closed xychu closed 2 years ago

xychu commented 2 years ago

Combine dev number with inode to identifies a file uniquely, since the same inode could be used at a different filesystem.

xychu commented 2 years ago

This is an interesting edge-case that I hadn't considered. Out of curiosity, did you get unlucky enough to actually encounter this while using fcp, or is it something that you just noticed while reading through the code?

Got bitten when coping data from USB SSD deivce via fcp :-( And I'll update my code accordingly.

Svetlitski commented 2 years ago

Thank you! I force-pushed just to fix a couple of spelling/phrasing issues in the comments instead of going through the hassle of flagging them in review and asking you to fix them. The failing test-case on CI is just the GitHub actions cache not working, so I'm going to merge this. Thanks for the contribution!