Sortcp - Tool that sorts files prior to copying to lower disk fragmentation

I wanted to share this in case others find it interesting.
It’s nowhere near perfect and finished, more so I’m struggling to find a way how to stat a file in 0.15.2 that it does not follow the sym_links by default. Currently works only if you pass a directory as an argument instead of a file… :frowning:
0.16 branch is using a linear approach when processing directories. It recurses, then creates a path, then copies over sym_links and files to a destination. Theoretically should be faster but it’s slower than 0.15.2 mixed approach, that does path creation and copy within a recursion itself.
Please, write your thoughts either in the repo or here. Code suggestions, logic changes, If I use inlining too much, should I even use it, etc etc. I’m always learning and always feel bad with the lack of my knowledge :joy:
My goal is to lower disk fragmentation as much as possible while keeping the speed in comparison to GNU cp and rsync. Thinking when it gets to somewhere to add parallelism as well.

2 Likes