Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Copy spanning multiple DVDs

by Anonymous Monk
on May 02, 2006 at 18:42 UTC ( #546968=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I want to write a script that will copy a source directory tree into a new directory tree structure that will be ready to be burned to DVD. Something like DVD1, DVD2, DVD3, where each directory is limited to 4GB. A program like burned to the brim would be perfect except it windows based and I need something that is platform independent. I looked at the cpan modules and File::Copy::Recursive seemed like a good starting point but it doesn't support limits by directory size. Before writing something new I was wondering if anyone knew of something available or a better starting module.

Thank you in advance!

Replies are listed 'Best First'.
Re: Copy spanning multiple DVDs
by marto (Cardinal) on May 02, 2006 at 19:18 UTC
      Martin,thanks for the pointers to other nodes. I had done a super search but I used other keywords (copying, spanning). I hadn't heard of the knapsack problem. This is a great starting point. It actually nearly solves the complete problem.

      I love perlmonks, there's always something new to learn.

Re: Copy spanning multiple DVDs
by revdiablo (Prior) on May 02, 2006 at 19:42 UTC

    In addition to marto's excellent pointers, you might want to have a look at my module, Algorithm::BinPack. I wrote the module with exactly this kind of problem in mind. You'll still have to do a bit of work, but the hard part (filling the DVDs as much as possible) is done for you.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://546968]
Approved by ikegami
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-10-25 18:00 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (89 votes). Check out past polls.