Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create an xml file from (a selection of) the filesystemtree?

Status
Not open for further replies.

tjayvb

Programmer
Sep 23, 2003
3
NL
How can I search through a (selected part of) the filesystem from a folder that the user can fill in, to build an output XML file that contains a structure of only the folders including files, the output should be like this
(so I only want the folders with files in it):
<xml>
<folder path=&quot;c:\dir\dir1&quot; title=&quot;dir dir1&quot;>
<file name=&quot;test.doc&quot;/>
<file name=&quot;test2.doc&quot;/>
<file name=&quot;test3.doc&quot;/>
</folder>
<folder path=&quot;c:\dir\dir2&quot; title=&quot;dir dir2&quot;>
<file name=&quot;test.doc&quot;/>
</folder>
<folder path=&quot;c:\dir\dir2\dir&quot; title=&quot;dir dir2 dir&quot;>
<file name=&quot;test.doc&quot;/>
</folder>
</xml>

thanks in advance for your reaction
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top