[Debburn-devel] Do you have any API documentation.

Steve McIntyre steve at einval.com
Sun Mar 29 19:25:17 UTC 2009


On Sun, Mar 29, 2009 at 12:23:50PM -0500, Brian P. Barnes wrote:
> Steve,

Hi again Brian,

> I did manage to Google your docs, but not on cdrkit.org. A very  
> comprehensive list, most far over my head.

:-)

> The best the LinuxQuestions.org gang and I could come up with is far  
> better than some funky dos hash, the actual system date/time to the  
> hundredth of a second. This should make a perfect, unique primary index  
> tattooed on the dvd at birth.
>
> Here's the bottom line:
> brianp at godzilla:~$ head -n 10 /dev/sr? | strings -n 10 | freq.pl -wu |  
> gr.pl '^[12]\d{8,}$'
> 2008120810514400
> 2009011613142100
> 2009011613320000
> 2009012713304400
>
> Freq.pl is just a frequency counter, hashing on words instead of lines  
> (-W) and showing unique tokens, rather than counts (-U). Gr.pl is just a  
> grep-like script which uses Perl regular expressions, in this case a  
> number starting with a 1 or a 2 with at  least 8 digits.

OK.

What you've found there is information in the "primary volume
descriptor", basically the filesystem headers. UDF (most common on
DVDs) and ISO9660 (the most common data CD filesystem) both use this
structure. The "isoinfo" command can tell you more about the contents
of that structure if you want it: check for it in the
genisoimage/mkisofs/cdrkit/cdrtools package depending on which Linux
distribution you're using.

The numbers you have there are, in some order:

 * Creation Date
 * Modification Date
 * Expiration Date
 * Effective Date

so yes, they should be a reasonable base for identifying
things. Although, they're not *guaranteed* to be unique. There are
other fields you could use as well: Volume ID (as you've already
seen), application ID, preparer ID, etc.

> I have some very old music cds (.wavs) which don't work, but no biggie.  

Yeah, that's expected. Audio CDs don't have a filesystem on them so
you can't use the same trick. The most common way to catalogue them is
to use the table of contents on the CD instead. See
http://en.wikipedia.org/wiki/CDDB for a description of that.

> Is this a robust method?
>
> Thanks for getting back to me and especially thanks for supporting Open  
> Source!

No problem, glad to help. :-)

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
  Armed with "Valor": "Centurion" represents quality of Discipline,
  Honor, Integrity and Loyalty. Now you don't have to be a Caesar to
  concord the digital world while feeling safe and proud.




More information about the Debburn-devel mailing list