opensubscriber
   Find in this group all groups
 
Unknown more information…

d : discrecording@lists.apple.com 8 December 2005 • 6:01AM -0500

Re: Checking for free space (was "Re: erase before burn")
by Ed Wynne

REPLY TO AUTHOR
 
REPLY TO GROUP





On Dec 7, 2005, at 12:59 PM, John C. Daub wrote:
> I'm a newbie to this Disc Recording stuff, and after having read  
> the below I
> changed some of my code but apparently I didn't change it correctly  
> and thus
> my "free space" calculations didn't work out. So, I'm seeking  
> clarification.
> I tried searching the mailing list archives and the docs (pity those
> conceptual docs got put on the backburner), but didn't see an  
> answer to my
> question.

Yeah, this is a confusing topic that could benefit greatly from  
conceptual docs.

> <snip>
>
> Based on the above message, I changed my code from using the
> kDRDeviceMediaBlocksFreeKey to use the  
> kDRDeviceMediaBlocksOverwritableKey.
> And that seemed to work out ok when burning to a CD-R the first  
> time. But if
> we then tried to append to the same CD-R, it would fail saying  
> there's not
> enough disk space (the appends worked fine with
> kDRDeviceMediaBlocksFreeKey).
>
> Rereading the above, it sounds like one should only use  
> BlocksOverwritable
> if you know the media is rewritable (and then, I assume if the user
> specified to erase before burning). So is that the case? That I  
> should check
> what type of media it is first, then based on the media type (and  
> perhaps
> the options the user set in the burn setup dialog) I determine  
> which key to
> check?
>
> Bottom line: just how is one to determine the free space on the  
> burnable
> media? What's the procedure, what keys/data are we to check, any  
> special
> math considerations (e.g. to deal with that uncontrollable drive  
> lameness
> mentioned above).

kDRDeviceMediaBlocksOverwritableKey can be used on any media that is
in, or can be placed in, an overwritable state.

So what exactly is an overwritable state? It is the state where media  
can be
considered entirely writable, and why the overwritable blocks value  
directly
corresponds to the size of the media regardless of what is currently  
on it.

Rewritable media can always be erased, and then rewritten in its  
entirety,
so it is always considered overwritable.

Write-once media, if its blank, can also be written in its entirety  
and is also
considered overwritable.

Write-once media, that has been partially written, can never again enter
a state where it is entirely writable and will have lost its  
overwritable
designation.

The bottom line is that you can use kDRDeviceMediaBlocksOverwritableKey,
unless you want to append. If appending is important, and for many  
situations
it is not, you must also use the free space keys as appropriate.

-Ed

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Discrecording mailing list      (Discrecording@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/discrecording/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.