Please note that simply looking at a file's size does not do the same thing as du. The du command will tell you the amount of disk space that each file is using by rounding up to the current sector size. This discrepency was the whole purpose of cog's Filesys::DiskUsage 0.04 version - to allow you to better approximate what the du command does. Note that you have to tell Filesys::DiskUsage what sector size to use, which is moderately (but not completely) unfortunate.

This is completely fortunate, however, in the OP's scenario. I'm betting that the 4GB boundary is for DVDs. And DVDs will not have the same sector size as their ext3 or jfs or ntfs or whatever filesystem. So what du thinks is the total space and what it will be on the DVD may not match. It may be close enough, but maybe not.

As I said above, I did exactly the same thing for CDs. And the sector size on CDs is 1K. Which doesn't often match the sector size on hard disks. So I use Filesys::DiskUsage and pass in a sector-size of 1024, and I know what the disk usage will be on my target media. In my case, the difference will be dozens of MB between what du reports on the hard disk and what it would report on CDs, and that difference could significantly alter the layout of the CDs, possibly even reducing the number of CDs that I need by one - multiplied over the cost of manufacturing, it can save some real dollars, not only likely saving the cost of developing that patch and using it, but also reducing the weight of the box the CDs are in, and producing less ill will from customers who don't like how many CDs we already have in those boxes - that's worth real money, too.


In reply to Re^2: Using an array, how do I search one directory area and copy to another area by Tanktalus
in thread Using an array, how do I search one directory area and copy to another area by ckaspar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.