• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Finding network mounted DVDs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding network mounted DVDs


  • Subject: Finding network mounted DVDs
  • From: P Teeson <email@hidden>
  • Date: Wed, 09 Mar 2011 23:27:22 -0500

In my app I want to find all mounted DVD volumes, including those mounted from other Macs on my network.
The reason is that I want the user to be able to choose the one they want.

Here is the code I am using to find them (based on the CDROM sample from Apple):

kern_return_t FindEjectableDVDMedia(io_iterator_t *mediaIterator)
{
    kern_return_t		kernResult;
    CFMutableDictionaryRef	classesToMatch;

    // DVD media are instances of class kIODVDMediaClass
    classesToMatch = IOServiceMatching(kIODVDMediaClass);

    if (classesToMatch == NULL) {
        printf("IOServiceMatching returned a NULL dictionary.\n");
    }
    else {
	CFDictionaryAddValue(classesToMatch, CFSTR(kIOMediaEjectableKey), kCFBooleanTrue);
    }

     kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, mediaIterator);
    if (KERN_SUCCESS != kernResult) {
        printf("IOServiceGetMatchingServices returned 0xx\n", kernResult);
    }

    return kernResult;
}

However when I do
	nextMedia = IOIteratorNext(mediaIterator);
in my loop for all devices it returns 0 after the first iteration.
So apparently I have not found the network mounted DVD.
But DVDPlayer sees it as a mounted disk and will play the movie.

I mounted the network DVD using the Finder and "Connect to server..."
The server is my wife's Mac running Tiger and sure enough the DVD was mounted.
(But as I said shows up on my desktop with the rectangular disk icon on my Snow Leopard 10.6
rather than the circular DVD icon for the DVD on my local machine.)

Your advice is solicited and appreciated.  TIA

Peter_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Outlets Not Connected In awakeFromNib
  • Next by Date: Re: NSTableView: which delegate after a drag operation?
  • Previous by thread: Cocoaheads Lake Forest meeting TONIGHT, 7pm, El Toro library
  • Next by thread: ANN: Cocoa task based scripting using KosmicTask 1.1 Preview 1
  • Index(es):
    • Date
    • Thread