Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Play any region-coded DVD' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Play any region-coded DVD
Authored by: rammjet on Mar 02, '09 10:34:16AM
I think there are some bad assumptions here.
set diskname to "/dev/rdisk" & ((length of (list disks)) - 1)
"/dev/rdisk" needs to define the number for the physical drive starting with "0" (ie. /dev/rdisk0, /dev/rdisk1, etc).

The "list disks" command lists all of the volumes connected to the computer. I have 4 hard drives totalling 16 volumes (partitions). And I have a server connected. All 17 of those get counted individually by "list disks" and the result is "/dev/rdisk16" which means the external DVD drive would be counted as "/dev/rdisk17" when it gets connected.

But, the 4 physical hard drives really occupy "/dev/rdisk0" thru "/dev/rdisk3" and the connected server does not use a "/dev/rdisk" mount point. So, in theory, when the external DVD drive get connected, it would occupy "/dev/rdisk4".

But what if you put a DVD into the external drive but don't immediately play it? And then later you plug in another drive, say a thumb flash drive. The flash drive now becomes the last device after the external DVD drive. On my system, the DVD drive would be "/dev/rdisk4" and the flash drive would be "/dev/rdisk5". So, you then run the script, and even if the "list disks" command actually worked the way you were thinking it would, the script would then return "/dev/rdisk5" for the DVD drive even though it is really "/dev/rdisk4". You cannot assume that the DVD drive is always the last device in the chain.

You need to find a more clever way to detect the real virtual device number for the DVD drive.

[ Reply to This | # ]

Play any region-coded DVD
Authored by: mlnoone on Apr 12, '09 10:19:12AM

Thanks for pointing that out.. fact is, I couldn't come up with a cleverer way!

---
Mohan Noone



[ Reply to This | # ]