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?
1) Free CD space available for writing
2) Used disk space
or at least one of them?
ASKER
Found a way to count used space, but still need free space. NERO_CD_INFO::ncdiFreeCapa cityInBloc ks contains free space in blocks, but what is block size? NERO_TRACK_INFO contains ntiBlockSize, but it is valid for track only.
ASKER
Can I be sure that blocks are always 2048 bytes? This is what NERO_TRACK_INFO::ntiBlockS ize 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
- 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.
ASKER
No audio and video, only files. So, free space is always:
ncdiFreeCapacityInBlocks*2 048 ?
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?
ncdiFreeCapacityInBlocks*2
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
1) NERO_CD_INFO.ncdiFreeCapac
2) I guess you need to parse the track info array starting at NERO_CD_INFO.ncdiTrackInfo