Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, add files and folders at International Chat: Software related forum; Hi, can somone give me code exmple of a function that adds Recursively files and folder. many thanks.


Reply
 
Thread Tools
Old 14-07-2005   #1 (permalink)
New on Forum
 
Join Date: Jul 2005
Posts: 18
add files and folders

Hi,

can somone give me code exmple of a function that adds Recursively files and folder.

many thanks.
zikman is offline   Reply With Quote
Old 14-07-2005   #2 (permalink)
New on Forum
 
Join Date: Jul 2005
Posts: 6
Re: add files and folders

What language are you using?
klopek is offline   Reply With Quote
Old 17-07-2005   #3 (permalink)
New on Forum
 
Join Date: Jul 2005
Posts: 2
Re: add files and folders

I have the same question as zikman's. I'm using VB. Thanks in advance.
jason_forever is offline   Reply With Quote
Old 17-07-2005   #4 (permalink)
New on Forum
 
Join Date: Jul 2005
Posts: 18
Re: add files and folders

c++ mfc
zikman is offline   Reply With Quote
Old 18-07-2005   #5 (permalink)
New on Forum
 
Join Date: Jul 2005
Posts: 6
Re: add files and folders

I havent done exactly what you guys are looking for, but I can give you all generally what you need. First the recursive function for finding the directories...

recursiveFn(string dir)
{
WIN32_FIND_DATA findData;
HANDLE hFind=FindFirstFile((dir+"\\*.*").c_str(), &findData);

do {
string sFileName(findData.cFileName); //sFileName will contain the name of the file or directory
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) // is a directory
//do the directory stuff (recurse etc)
else
// you know you have a file

}while (FindNextFile(hFind, &findData));
}

I used somethign like this and stored the results in what was basically a vector of filepaths.

For the burning, you will need to create a bunch of NERO_ISO_ITEMS. Its really just a linked list or items.

Once you have the data structure that is holding the files and directories that you want to burn, you just need to loop or recurse through the items.

As you go along, keep creating new NERO_ISO_ITEMS and fill in the filename and the sourceFilePath for the items.
As you iterate through, you need to keep track of 2 or 3 NERO_ISO_ITEMS at once, and this is really the key to building the list. As you create new items, they get attached to the list via setting their previous siblings ->nextItem to them. If the item is a directory, you set the isDirectory part of the NERO_ISO_ITEM to true, and if it has items in it, you add them by setting the subDirFirstItem on the first one, and then just attaching the other files/directories in there using the nextItem field.

Keep track of whatever your initial NERO_ISO_ITEM was that you created. After you are done attaching all of the siblings and subdirectories, you need to use something like this: m_DVD.nwcdIsoTrack = NeroCreateIsoTrackEx(m_RootItem, m_sDiscTitle, NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET|NCITEF_CREATE_UDF_FS);

Where the m_DVD is your NERO_WRITE_CD.

Obviously, there is alot of other NERO things that need to be initialized, and settings that have to be set, but you can basically copy and paste almost 100% of that from the NeroFiddles code.
klopek is offline   Reply With Quote
Old 25-07-2005   #6 (permalink)
CD Freaks Member
 
Join Date: Mar 2005
Posts: 109
Re: add files and folders

Just a few notes:

- FindFirstFile may return INVALID_HANDLE_VALUE

- Remember to skip "dots" directories ("." and "..")

- The hFind handle must be closed after the while loop, otherwise the NT system will sooner or later close your application. In my personal experience, closing an INVALID_HANDLE_VALUE will extremely slow down the process for whatever reason, so it would be best to "if (hFile != INVALID_HANDLE_VALUE) ::FindClose(hFind);".
Oliver M. is offline   Reply With Quote
 
Reply


If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here



Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
View/Add hidden files/folders in Nero g_goyal2000 Nero & InCD 11 07-08-2007 16:26
Add multiple files to Listbox, then burn the list of files rdcrumbaker Nero SDK Discussion Forum 4 23-03-2006 04:19
Can't add VIDEO_TS folders in Nero Express david_h Nero & InCD 6 09-01-2006 01:07
Help Add Folders serjaime78 Nero SDK Discussion Forum 0 17-10-2005 12:51
Files/Folders in C# OliverG Nero SDK Discussion Forum 1 12-01-2005 09:57


All times are GMT +2. The time now is 21:05.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0