• 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
Re: calling open() on an older cd device returns EBUSY??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling open() on an older cd device returns EBUSY??


  • Subject: Re: calling open() on an older cd device returns EBUSY??
  • From: "David M. Cotter" <email@hidden>
  • Date: Tue, 03 May 2005 11:10:51 -0700

huh, well that's quite interesting, cuz the same CD works just fine on my other computer (with the DVD-R).

This is how I get the device name, as documented by Apple:

GetVolParmsInfoBuffer volumeParms; structclr(volumeParms);
HParamBlockRec pb;

// Use the volume reference number to retrieve the volume parameters. See the documentation
// on PBHGetVolParmsSync for other possible ways to specify a volume.
pb.ioParam.ioNamePtr = NULL;
pb.ioParam.ioVRefNum = volSpec.vRefNum;
pb.ioParam.ioBuffer = (Ptr) &volumeParms;
pb.ioParam.ioReqCount = sizeof(volumeParms);
ETRL(PBHGetVolParmsSync(&pb), "Error PBHGetVolParmsSync");

// A version 4 GetVolParmsInfoBuffer contains the BSD node name in the vMDeviceID field.
// It is actually a char * value. This is mentioned in the header CoreServices/CarbonCore/Files.h.
const char *bsdNodeNameZ = (char *)volumeParms.vMDeviceID;

// create (return) the device path to the volume
sprintf(pathZ, "/dev/%s", bsdNodeNameZ);

why does this code work fine on my DVD-R, but not on my CD-R/W? It also works fine on my Plextor CD-R/W

On May 3, 2005, at 7:28 AM, Shantonu Sen wrote:

/dev/disk2 is the entire CD. You want a particular session, like the first session. that would be /dev/disk2s1 (which might have further subdivision into /dev/disk2s1s3). For ISO CDs, it might be /dev/disk2s0.

Shantonu

On May 2, 2005, at 11:49 PM, David M.Cotter wrote:

i_fd = open(i_bsd_vol_path, O_RDONLY, 0);

i_bsd_vol_path is "/dev/disk2" which is my cd drive (trust me)
but i_fd == -1 and errno == 16 (EBUSY)

Why is the device busy? Is it really just "not capable"? .

the drive that fails is a "<x-tad-smaller>MATSHITA</x-tad-smaller> CD-RW CW-7121"

this works fine on a modern drive eg: "<x-tad-smaller>MATSHITA DVD-R UJ-815</x-tad-smaller>" or "" _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: calling open() on an older cd device returns EBUSY??
      • From: Shantonu Sen <email@hidden>
References: 
 >calling open() on an older cd device returns EBUSY?? (From: "David M.Cotter" <email@hidden>)
 >Re: calling open() on an older cd device returns EBUSY?? (From: Shantonu Sen <email@hidden>)

  • Prev by Date: Re: calling open() on an older cd device returns EBUSY??
  • Next by Date: Re: calling open() on an older cd device returns EBUSY??
  • Previous by thread: Re: calling open() on an older cd device returns EBUSY??
  • Next by thread: Re: calling open() on an older cd device returns EBUSY??
  • Index(es):
    • Date
    • Thread