martymac / fpart

Sort files and pack them into partitions
https://www.fpart.org/
BSD 2-Clause "Simplified" License
230 stars 39 forks source link

Partition files do not have sort-friendly filenames #12

Closed alexhunsley closed 5 years ago

alexhunsley commented 5 years ago

If I generate partition files with the name 'part', I end up with files like this:

part.0
part.1
part.2
...
part.10
part.11
...
part.100
part.101

These filenames aren't 0-padded so don't sort into a logical order:

part.0
part.1
part.10
part.11
part.12
part.13
part.14

Could we have an option for generating 0-padded filenames please? i.e. part.000, part.001, etc.

martymac commented 5 years ago

Hello @alexhunsley,

First of all, thanks for using fpart and for your feedback!

Unfortunately, that is not as simple as it seems : padding is just impossible in live mode as you do not know how many partitions will be generated (so you don't know how many 0's you have to prepend).

As I do not want different naming schemes for live vs non-live mode, I prefer leaving the things as they are, even for standard mode.

I am sure you can get around the sorting issue using a numerical sort (e.g. option -n for the sort utility).

Hope that helps, Best regards,

Ganael.

alexhunsley commented 5 years ago

Ah that's a good point! Cheers.