[Tutor] Sorting of files based on filesize

Klas Marteleur klas.martelleur at telia.com
Mon Apr 11 18:06:10 CEST 2005


Hi
Some of my harddrives are getting full and i would like to burn the files to 
some cheep DVD's. Filesizes range from lets say 1Mb to 1Gb. 

Ofcourse i would like to optimize the size of each DVD to be as close to 4.7Gb 
as possible (to save this cheep media :) ).

There are plenty of software that are able to index my DVD's so sorting 
between disks is not a problem. Just size.

What i would like to do is write a Python program that could sort my files 
(based on size) into chunks as close to a given storage size (DVD 4.7Gb, CD 
650Mb...), and minimize the use of disks. Does anyone know of if something 
like this is done before in Python, that i could look at?

With a couple of hundred files it should be a lot of possible combinations. So 
I am not lookng for something absolute, just something that could help me get 
a little closer to the truth :)

Its the "sorting function" that i am looking for, getting filesizes and do the 
actual sorting of files on disk i will worry about later.

Kind regards
Klas



More information about the Tutor mailing list