Burning Multisession CDs with IMAPI2 in WSH - Final thoughts
(Page 5 of 5 )
As you can see, it is very easy to write multisession discs using the IMAPI2 control. This script can be run over and over again for as long as there is space remaining on the disc.
While writing multisession discs can be beneficial, there a few things to keep in mind.
Once a session is written to disc, it is permanent. This means that existing sessions remain on the disc regardless of what future sessions add. This can lead to some unexpected results if you're not careful.
Let's take a look at an example. If you were to begin a multisession disc by writing a 20MB file called Mydatabase.mdb to the root of a disc, then any time that you read that disc, you would see this file at the root of the disc in My Computer.
Now let's say that the contents of this file have changed and you want to update it on your disc. The file now contains 25MB of data. You can create a new session and write the updated file to the existing disc.
What results is nearly identical to the first disc. In my computer you will still see a single file named Mydatabase.mdb at the root of your CD. This will be the newly added 25MB version of the file.
As you add sessions to a disc, each session virtually overwrites any existing data on the disc if the same directory structure and file name exists. You will only be able to see and access the most recent version of a file. Thus, you can overwrite the existing file with an updated version when adding a new session.
However, as I stated earlier, sessions on disc are permanent. This means that the original session and, in fact, the original file, still remain written on the disc, completely intact. So while it appears that you have overwritten the original file, this is not true because you have not reclaimed any of the space that it consumed on disc. In essence, your 25MB file consumes 45MB of disc space-the amount of space used each time the file is written.
So while you've accomplished the effort of updating a file on your disc by writing a new version of the file in a new session, you must keep in mind that you cannot reclaim the space used by the original file. If you were updating an entire directory structure or very large files, disc space may very well become an issue.
That wraps up this article on writing multisession discs using the IMAPI2 control in WSH. Go ahead and have some fun with it. Until next time, keep coding!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |