Getting serail number of a CD

Discussion in 'Mac Programming' started by ithil, Jul 9, 2006.

  1. macrumors newbie

    Joined:
    Jul 2, 2006
    #1
    Hi all,

    How to get the serial number of a CD on Mac OS X? Is there any
    replacement for the function GetvolumeInformation which gives the
    serial number on Windows. If not how I can get a unique number that
    identifies the CD.

    Thanks.
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    I don't even think CDs have unique serial numbers by default, do they? I really don't know but I've not heard of such a thing, at least not in a general case. I suppose you could burn a number on the CD somewhere.
     
  3. macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #3
    OS X uses a serial number?

    That's news to me, but I've used the Family Pack license since 10.2.
     
  4. Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    Whakatane, New Zealand
    #4
    When you format a volume in DOS, it assigns it a 1024-bit serial number. It's done this for as long as I can remember (I started with DOS 3.3). In the case of a DOS-formatted floppy or hard drive, this number is recorded onto the disk - if you put the same disk into a different computer then you'll see the same serial. If you reformat the disk then you'll get a different serial.

    I have no idea whether Mac-formatted (or even Windows-formatted) CDs use serial numbers. I don't have a Windows computer on-hand to take a look.
     
  5. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #5
    He means a different sort of serial number....:rolleyes:
     
  6. macrumors 65816

    ipacmm

    Joined:
    Jun 17, 2003
    Location:
    Cincinnati, OH
    #6
    OS X Server uses serial numbers for each version.
     
  7. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #7
    You mean something like this that's available from the Info button in Disk Utility?
     

    Attached Files:

  8. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    That does not appear to be a CD!
     
  9. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #9
    I said something like this.
     
  10. macrumors P6

    IJ Reilly

    Joined:
    Jul 16, 2002
    Location:
    Palookaville
    #10
    I'm not sure if this is what the OP is after, but many people think that audio CDs have a unique serial number because of the way they are automatically indexed by GraceNote the moment you insert the CD into the computer (assuming you've got a live Internet connection of course). In fact, GraceNote relies on a combination of track number, track length, track order and (I believe) overall length to determine which CD you've inserted.
     
  11. macrumors 68020

    Krevnik

    Joined:
    Sep 8, 2003
    #11
    For audio CDs, this is true. Although IIRC, HFS+ volumes use a UUID. Now the question here is:

    What type of volume are you trying to get an ID for? HFS+, UDF, ISO9660, FAT, NTFS?

    UDF doesn't seem to include a UUID, and I would assume ISO9660 would also lack such a UUID. FAT is before GUIDs, so I have a feeling you won't get love there either, and OS X isn't aware of NTFS enough to read a GUID from that. Joliet is an unknown. HFS+ volumes all have UUIDs, from what I can tell, but I haven't done testing to see if it is truly unique between discs, and probably wouldn't be if they are pressed, but could be if they are all burnt.

    Now, IIRC, there is an actual UUID that pressed CDs have, and CD-Rs as well. HOWEVER, it isn't in any part of the block data available, but rather in a track that only the drive itself is allowed to read (since LBA 0 is /after/ this track, and addresses are unsigned). Drives can give access to read this, although I don't believe the drive is required to make the disc serial ID accessible. I know of a couple of devices (PS2, for example) which do use this information for anti-copy schemes.
     
  12. thread starter macrumors newbie

    Joined:
    Jul 2, 2006
    #12
    Thanks for the help..
    I am porting a Windows application on Mac. I just want a replacement for the API "GetVolumeInformation" by which we can get the Unique number ( called serial number on Windows) for CD. Or is there a way to identify a CD (of any format) uniquely.
     

Share This Page