fs2xml is a PHP script that creates an XML representation of a file system hierarchy by collecting information about all the files and folders under a given directory. The result is an XML "tree" mimicking the structure of a directory, where each node in the XML tree corresponds to a file or folder. Metadata (like the full path to a file or folder) are stored as node attributes.
Let's say that you want to create an XML representation of "/home/sid", whose structure is shown below.
/home/sid
/home/sid/images
/home/sid/images/sunflower.gif
/home/sid/music
/home/sid/music/Le Pianc -
Guitar boy.mp3
/home/sid/texts
/home/sid/texts/bachelor-chow-cookbook.pdfRun the script anywhere under the document root of your server (make sure the script is executable). You'll be greeted with this simple form:
Enter the right path (in this case, "/home/sid"). Click on "Generate". That's it! The script will generate an XML file which you can save. Here is the generated XML content: