[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



On Wed, 15 Dec 2004, Courtney Thomas wrote:

> Sriad,
> 
> I only want the 'picking' to simply be.... to merely add the file's 
> sizes until >650MB, then don't add the one that puts the total >650MB 
> and the 'moved-to' dir then contains that set the <=650MB, since each is 
> moved to the new 'container' dir, and the program stops.
> 
> Hope that clarifies my simple objective,
> Courtney

I understood this to mean, that you would like to continue this process 
until all files are in directories sized <=650MB.
If so, it is easy to end up with a very large number of directories

Consider 5 files :

1. 100 MB
2. 600 MB
3. 400 MB
4. 100 MB
5. 300 MB

The algo above would create :

dir 1 : 100 (600 pushes it over 650)
dir 2 : 600 (400 pushes it over 650)
dir 3 : 400 + 100 (300 pushes it over 650)
dir 4 : 300

Ideally it is possible to do this as :

dir 1: 100 + 400 + 100
dir 2: 600
dir 3: 300

ie. in 3 dirs instead of 4. If you have a larger number of files, you 
could end up with many directories like dir 1 (potentially underutilized)
The aim would be to keep the number of directories to a minimum (latter 
case)

Hope that explains what I was trying to get at.
Other replies in the thread describe simple and acceptable solutions to 
the problem (box packing problem).


Thanks,
sriad


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00561" href="msg00561.html">To: Jerry Yu...     Re: [ale] 2 Perl questions ?</a></strong>
<ul><li><em>From:</em> ccthomas at joimail.com (Courtney Thomas)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00561.html">To: Jerry Yu...     Re: [ale] 2 Perl questions ?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00563.html">[ale] Make RAID 1 during install</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00561.html">To: Jerry Yu...     Re: [ale] 2 Perl questions ?</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00565.html">[ale] OT BS DSL/DNS</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00562"><strong>Date</strong></a></li>
<li><a href="threads.html#00562"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>