Link to home
Start Free TrialLog in
Avatar of AlexFM
AlexFM

asked on

Disk free space using Nero SDK

Having NERO_CD_INFO structure returned by NeroGetCDInfo how can I count:
1) Free CD space available for writing
2) Used disk space

or at least one of them?
Avatar of _nn_
_nn_

Looks like the forum at cdfreaks isn't very helpful ;)

1) NERO_CD_INFO.ncdiFreeCapacityInBlocks should give you the information (blocks are 2048 bytes long)
2) I guess you need to parse the track info array starting at NERO_CD_INFO.ncdiTrackInfos and add all NERO_TRACK_INFO.ntiTrackLengthInBlks
Avatar of AlexFM

ASKER

Found a way to count used space, but still need free space. NERO_CD_INFO::ncdiFreeCapacityInBlocks contains free space in blocks, but what is block size? NERO_TRACK_INFO contains ntiBlockSize, but it is valid for track only.
Avatar of AlexFM

ASKER

Can I be sure that blocks are always 2048 bytes? This is what NERO_TRACK_INFO::ntiBlockSize shows, but this is about track only?
Depends on what you're gonna put in them.
- if it's "normal" data, it will be 2048 bytes.
- if you put audio or video in these tracks (mode 2 form 2), effective block size will be 2324 bytes.

I like this page, explains mode 1/2 form 1/2 very clearly :
http://www.disctronics.co.uk/technology/cd-rom/cdrom_spec.htm
So what I meant with "blocks are 2048 bytes long" is actually : if you're dealing exclusively with files (no mixed mode audio + files for instance), block sizes will always be 2048. And beware that mode2/form2 isn't suitable for files, only for "multimedia" tracks.
Avatar of AlexFM

ASKER

No audio and video, only files. So, free space is always:

ncdiFreeCapacityInBlocks*2048 ?

I mean, it doesn't matter that effective block size is 2324 bytes. The space which can be used for my data is 2048 bytes per block always?
ASKER CERTIFIED SOLUTION
Avatar of _nn_
_nn_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexFM

ASKER

Thanks!
Actually, the total size of a block is exactly 2352 bytes. Depending on the format, bytes are used for sync, header, EDC and ECC. In mode 1 and mode2/form1, you get 2048 for user data. In mode2/form2 there's no ECC, so you get 276 bytes more, but you loose in reliability, which makes that these kind of tracks are only used for data types who support to be concealed, typically audio and/or video.