Re: Read folder structure and convert to xml


[ Related Articles and Replies ] [ DelphiLand Discussion Forum ]

Posted by webmaster Guido on July 04, 2002 at 06:39:12:

In Reply to: Read folder structure and convert to xml posted by fennis on July 02, 2002 at 14:01:52:

: I want to be able to read a folder structure, i.e. all files and sub folders and convert that structure in to an xml file -which i will be able to interogate with ASP (for use on a web page). Does anyone know the best way to go about this. I will eb using Delphi 4.
--------------

For building the directory ("folder" in WinSpeak) structure into a StringList, you could start off with the code from the chapter "Find files" in DelphiLand's section "CodeSnips". Next, you could process all the items of that StringList, add all necessary xml-stuff. Next, if necessary, add items for header and footer stuff. Finally, write the StringList to disk with SaveToFile.

While the example code is for building a list with all files with a given extension, you can easily adapt it for only listing directories (folders).


Related Articles and Replies:


[ Related Articles and Replies ] [ DelphiLand Discussion Forum ]