#1 Burning Software

It is currently Thu Dec 19, 2024 7:48 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Disk Space after Erasing
PostPosted: Wed Nov 22, 2006 9:54 pm 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Hi

Firstly, sorry for all the questions, i just want to make sure I get this right from the start.

In my app the user will need to have a completely blank disk. Naturally I check whether it needs erasing as follows:

bNeedToEraseDisk := m__UCHAR__DiscStatus in [DISC_STATUS_INCOMPLETE, DISC_STATUS_COMPLETE];


However I'm not 100% sure about checking how much disk space will be available _after_ the erase is complete.

I'm using:

if GetDiskSpaceRequiredInBytes>SelectedDevice_DiscSizeInfo.TotalDiscSize then
raise Exception.Create('Not enough space on disk');

(Where SelectedDevice_DiscSizeInfo.TotalDiscSize is set using the PrepareDSI as in your GUI demos).

Is that the best method?


Top
 Profile  
 
 Post subject: Re: Disk Space after Erasing
PostPosted: Wed Nov 22, 2006 10:43 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
This is not a good idea... Much better one would be to GetTrackInformation( 0xFF ) and check for NWA. For blank track (and blank disc) it should be 0 (zero). Disc status would not be correct for always writable media (DVD+RW, +RW, formatted -RW and BD-RE).

xexx wrote:
Hi

Firstly, sorry for all the questions, i just want to make sure I get this right from the start.

In my app the user will need to have a completely blank disk. Naturally I check whether it needs erasing as follows:

bNeedToEraseDisk := m__UCHAR__DiscStatus in [DISC_STATUS_INCOMPLETE, DISC_STATUS_COMPLETE];


However I'm not 100% sure about checking how much disk space will be available _after_ the erase is complete.

I'm using:

if GetDiskSpaceRequiredInBytes>SelectedDevice_DiscSizeInfo.TotalDiscSize then
raise Exception.Create('Not enough space on disk');

(Where SelectedDevice_DiscSizeInfo.TotalDiscSize is set using the PrepareDSI as in your GUI demos).

Is that the best method?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 12:45 am 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Thanks,

I've changed it to:

bNeedToEraseDisk := TRACK_INFORMATION.m__LONG__NextWritableAddress>0;


Is this the correct code to determine how much free space will be available after erasure?

(TRACK_INFORMATION.m__LONG__NextWritableAddress + TRACK_INFORMATION.m__LONG__FreeLBs) * MODE1_LB_SIZE_IN_UCHARS


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 11:24 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Yes, after erase.

Just FreeLBs * BlockSizeInUCHARs.

xexx wrote:
Thanks,

I've changed it to:

bNeedToEraseDisk := TRACK_INFORMATION.m__LONG__NextWritableAddress>0;


Is this the correct code to determine how much free space will be available after erasure?

(TRACK_INFORMATION.m__LONG__NextWritableAddress + TRACK_INFORMATION.m__LONG__FreeLBs) * MODE1_LB_SIZE_IN_UCHARS


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 11:30 pm 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Hi Anton

I haven't erased yet at the point where I am checking the space, so m__LONG__NextWritableAddress may be > 0. And all the space used by the previously written area should be recoverable (once the erase is done).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 11:37 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
I'm not sure what do you mean. Code should look like:

GetTrackInfo(...)

if ( NWA > 0 && IsDiscErasable )
{
EraseDisc();
}

// Do whatever you want here...

xexx wrote:
Hi Anton

I haven't erased yet at the point where I am checking the space, so m__LONG__NextWritableAddress may be > 0. And all the space used by the previously written area should be recoverable (once the erase is done).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group