Writing files to a CD
Hello there. My friend and I are designing an interface for a CD burner program. We are using a dialog-based MFC application and I have a question. I would like to know how I would go about writing data to a blank CD. If you have any ideas or suggestions please reply =)!
I had this problem some time ago & made some personal notes on the problem. Perhaps someone out there can provide further info.
Anyway, hope the following helps.
Attempts to save files directly to CD have result in the application reporting an ‘access denied’ error. After an investigation, the following was found to be the case.
On older Windows systems, CD writing is supported by third-party software, commonly Adaptec DirectCD. It appears that this software supports direct system write calls to the CD, hence writing files to the CD under these conditions is possible.
However, under later version of Windows, namely XP and 2000, CD writing is supported natively. The writing process has changed and direct system write calls are no longer supported. Therefore, an attempt to write directly to a CD path will fail. Instead, Windows 2000 and XP support a different process. When a user attempts to copy a file to the CD using Windows Explorer, the files are actually copied to a ‘CD Burning’ temporary directory. These files are only written to the CD prior to ejection.
It should be recognised that Windows applications in general do not support direct saving of files to CD under later versions of Windows. Not even Microsoft Word (2002) supports this, and it is accepted behaviour. However, if direct CD writing is to be a requirement, it is proposed that the application support the following steps when writing a file:
1. The application attempts to write the file as normal.
2. If writing fails with an ‘access denied’ error, the application should check whether the file path is located on a writable CD drive.
3. If this is the case, the application should attempt to locate the temporary CD Burning directory from the Windows registry.
4. If this is found, the application should write the file to this location, preserving any relevant directory structure.
Finally, it should be noted that this sequence of steps may prove problematic on computer systems possessing multiple CD writer drives, and further investigation may be necessary.