in reply to Checksumming dynamically created media (code)

As you are burning and checking complete DVDs, you might want to consider simply reading and checking the device instead of the mounted volume. If you have a SCSI DVD (likely considering your Sun hardware), this could be under /dev/sdc or maybe /dev/dvd. Simply opening that one as a file and reading from it could work, at least it works that way under Linux with harddisks.

  • Comment on Re: Checksumming dynamically created media (code)

Replies are listed 'Best First'.
Re (2): Checksumming dynamically created media (code)
by deprecated (Priest) on Jul 16, 2001 at 21:15 UTC
    This is a great idea.

    Can I use seek on a raw device? The problem we run into if we're going to read the whole device, of course, is that the system (burly as it may be) does not have 4.5gb of ram, and 3.5gb of swap is unweildy. So we can't just slurp the whole disk in and checksum it... I was thinking that if we can read in the first gig and the last gig and provide two checksums, we can be reasonably assured that the middle 2.5 gig are okay.

    dep.

    --
    Laziness, Impatience, Hubris, and Generosity.

      Compress::Zlib's crc32 function can update a CRC in pieces; you can call it with an existing CRC to update it. So you read a buffer full at a time and update your CRC:

      use Compress::Zlib my $crc = 0; while ($fh->read($buffer)) { $crc = Compress::Zlib::crc32($buffer, $crc); }