Writing on-the-fly

vbimport

#1

We would like to use the Nero API in our application for backup purposes. One of our goals is it not to store the entire CD/DVD image or data on disk, but to produce the data on-the-fly for Nero.

I looked into the different APIs, and I think that the File System Content Creation interfaces might suit our needs best. One thing is not really clear to me, though: It seems that I can produce the stream for a given file on-the-fly during the burning process. However, it seems like a requirement that the entire directory/file structure has to be set fixed before burning starts. This is quite difficult to provide with our present application, so I am looking for alternatives. Or is my understanding wrong altogether?

I also wasn’t able to find sample code for the File System Content Interfaces – did I miss it?

I would greatly appreciate any help. Thanks!


#2

However, it seems like a requirement that the entire directory/file structure has to be set fixed before burning starts.

Yes, exactly. This is true for all burning processes with NeroAPI since the filesystem with references to the filedata needs to be written first.

I also wasn’t able to find sample code for the File System Content Interfaces – did I miss it?

No, there is no documentation, yet. To use it do the following:


FileSystemContent::IFileSystemDescContainer pContainer(NeroCreateFileSystemContainer(NULL));
	
// set the volume name
pContainer->SetName("Volume");
// Get the root directory container,  
// build it's content recursively
FileSystemContent::IDirectoryContainer *pRoot=pContainer->Root();

// add some files to the container
FileSystemContent::IDirectoryEntryContainer *pDirEntry=pRoot->AddFile("autoexec.bat","c:\autoexec.bat",-1,-1);
pDirEntry=pRoot->AddFile("test.txt","c:\config.sys",-1,-1);
			
// add a directory to the container
FileSystemContent::IDirectoryContainer * pSubDirectory = pRoot->AddDirectory("New folder", -1);

// now you can use pSubDirectory to build the content of the sub directory
pDirEntry=pSubDirectory->AddFile("test.txt","c:\config.sys",-1,-1);

After you have build the filesystem tree, you can burn it with NeroBurn by using
the NERO_WRITE_FILE_SYSTEM_CONTENT structure.


#3

Thank you very much!