martymac / fpart

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

Empty partition 0 file #13

Closed alexhunsley closed 5 years ago

alexhunsley commented 5 years ago

I've tried fpart with 3.4GB of data and I'm getting a 0 length file for the first partition:

$ fpart -s 26084354560 -o dev-parts /Users/ah/Documents/dev
Part #0: size = 0, 0 file(s)
Part #1: size = 26084354560, 115597 file(s)
Part #2: size = 26084354560, 55717 file(s)
Part #3: size = 26084354560, 88715 file(s)
Part #4: size = 3924425658, 13859 file(s)

$ ls -l
total 99472
-rw-r-----  1 alex.hunsley  staff         0 Aug 19 16:23 dev-parts.0
-rw-r-----  1 alex.hunsley  staff  14548982 Aug 19 16:23 dev-parts.1
-rw-r-----  1 alex.hunsley  staff  12170472 Aug 19 16:23 dev-parts.2
-rw-r-----  1 alex.hunsley  staff  20652071 Aug 19 16:23 dev-parts.3
-rw-r-----  1 alex.hunsley  staff   1673407 Aug 19 16:23 dev-parts.4

Is that expected?

alexhunsley commented 5 years ago

Sorry, I didn't read about partition 0 being reserved for too-big files! My bad.

alexhunsley commented 2 years ago

Just had same 'problem' and found my own issue here two years later, so to be clear:

In '-s' mode, a '0' numbered partition file seems to be always created, to hold files too big for the specified -s size, even if no files were too big. So if the 0 numbered folder is empty, it's all good, ignore it.

Compare to '-n' mode (i.e. that number of partitions with data split as evenly as possible between them): partition file 0 is just a regular partition file containing file names.

In other words, it seems that filenames existing in 0th partition file is only an error condition in -s mode.