To: Jerry Yu... Re: [ale] 2 Perl questions ?

Geoffrey esoteric at 3times25.net
Wed Dec 15 13:27:06 EST 2004


Please trim your posts, and don't top post folks!

Aditya Srinivasan wrote:
> The other aspect of doing it on your own is :
> 
> The algorithm to separate files into groups <=650 sounds non trivial.
> 
> 1.List files and sizes
> 2.Sort
> 3.Pick appropriate combinations from the list (The hard part ??)

I wrote a shell script that did this many years ago (about 15), no 
longer have it.  Basically, it first determined how many 'N' items of 
size 'S' I needed.  Then it sorted by size and did the following:

bucket1       bucket2      ...  bucketN
largestfile   nextlargest       Nlargest
(N-1)largest  (N-2)largest      (N-3)largest

And so on.  It can be done pretty easily.  The more generic the 
solution, the more difficult, but the more useful.

-- 
Until later, Geoffrey



More information about the Ale mailing list