• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

I need some free software that will...

Rat

Not bored. Never bored.,
Joined
May 19, 2003
Messages
10,629
Location
Leicester, UK
...create an xml file (or similar) from a directory listing, including all subdirectories and files therein. I would also be happy with one that would do it to html, but it would have to be very customisable. Oh, and this is in Windows, of course. XP, if that helps.

What I basically need is a way to create a copy of an entire (very large) directory, so that it can be read on another machine in the way that the old folder view of Windows Explorer displays folder structures (tree on the left, contents on the right), but any similarly intuitive (!) method would be fine.

Obviously creating the listing in plain text form would be easy enough; something along the lines of
Code:
dir C:\DIRNAME\ /b /o /s
should do the trick. It should then be simple enough to parse that into xml as a tree structure (the right-pane thing isn't really necessary, as long as the files can be displayed in the tree), and I initally though that perhaps it was so simple, and I was missing something so obvious, that no one would have bothered to write an application to do it. But many many people have written gui applications to print a directory listing to a text file, which obviously does exactly what the simple command line above does, so it can't be that.

Searching sourceforge points me to something called hdlg, but it fails to run correctly on my machine (it's entirely in java, and needs to be called from the command line), so I can't tell if it would do what I want. I can find nothing else, either at sourceforge or other sites, that do this.

Any help much appreciated.

Cheers,
Rat.
 
I should add that the machine reading the output does, of course, not need access to any of these files; just the listing of them.

Cheers,
Rat.
 
I got one a while back called "Directory Lister". Unfortunately it's on the other computer so I can't look up the details. It was one of "Karen's Power Tools" from a Windows mag. Maybe it's still on the web somewhere. I think I got it from Download.com.

I always wondered why Windows didn't have a decent way to create, save, and print a directory list.
 
That's not bad (I found it by googling "Karen's Power Tools"), and it can print me a list of pure file names, including paths. This is a start, as I could then theoretically knock up a script to turn it into xml, with each line as a separate object, and use xsl to make a nice tree structure.

However, I am very lazy, and I was hoping someone had already done the hard work, so I wouldn't have to tax my brain with any of that thinking stuff.

Thanks for the start, though.

Cheers,
Rat.
 
It's pretty easy to make something like that as a batchfile in 4NT or 4Dos. Can't get more customisable than that!

4NT (trial version) and 4Dos (unsupported freeware for DOS, but seems to work fine in XP) can both be found here. If you need any help making a batch file that does what you want, just say which information you want it display and in what sort of lay-out and I can help.

I'm sure there are also ready made programs that can do this, but they might not be as customisable as you'd like it.
 
Hmm, while ignoring my idleness, that definitely appeals to my tinkering nature. That I will have a play with. I'll try the 4NT and see if I can knock something useable up. Thanks for the pointer.

To illustrate what I'm after, I will use an analogy (no, really it is). What I have is a list of projects, sorted by number, but let's pretend that it's a folder full of music (something I have to delete from work machines all the time, so I'm quite familiar with it).

If it were structured like Artist\Album\track, I would want something like
<artist>artist name
<album>album name
<track>track01</track><track>track02<track></album>
<album>next album
<track>track01</track><track>track02<track></album>
</artist>
<artist>next artist (alphabetically)
<album>album name

...and so on.

As I say, it should be easy enough to parse one format into the other, but I can't think of an easy way to do it. I'm only slightly comfortable with xsl, and it doesn't, to my knowledge, parse anything but xml anyway.

Anyway, I'll have a play with 4NT for the next 30 days (and then 4Dos) and see where I end up.

Cheers,
Rat.
It's pretty easy to make something like that as a batchfile in 4NT or 4Dos. Can't get more customisable than that!

4NT (trial version) and 4Dos (unsupported freeware for DOS, but seems to work fine in XP) can both be found here. If you need any help making a batch file that does what you want, just say which information you want it display and in what sort of lay-out and I can help.

I'm sure there are also ready made programs that can do this, but they might not be as customisable as you'd like it.
[/quote]
 
That's almost perfect. Thanks. The only trouble I have is that it doesn't automatically escape ampersands and create entities, but that's easily fixable.

I'm still going to tinker with all the other things suggested, though. Particularly 4dos, which I think may solve some other problems that I'd given up for lost.

Cheers,
Rat.
 
Well yeah, but that's the answer for damned near any computer question :)
From your avatar I'd have expected you to prefer Python. :-}

But yeah, I'd use Perl or Python, whichever I'd been doing more work in recently. They're very useful to know, and for quick satisfaction O'Reilly publishes both a Perl Cookbook and a Python Cookbook of ready-to-use solutions.
 
From your avatar I'd have expected you to prefer Python. :-}

But yeah, I'd use Perl or Python, whichever I'd been doing more work in recently. They're very useful to know, and for quick satisfaction O'Reilly publishes both a Perl Cookbook and a Python Cookbook of ready-to-use solutions.


Heh... yeah, not a python fan (perl hacks tend to eschew the strict structure of languages like Python), but it's decent. I should own stock in O'Reilly, I've bought so many of their books :)
 
I had a problem, so I used XML. Now I had two problems.*


* not original.

XML is fine... problem is it was touted as a panacea long before its supporting technologies were mature. I spent a few years saying "bah, I can do all that with a regex and a CSV" until XSL, XPath, etc. matured.

And don't even get me started on funky MS XML parsers... OR godawful W3C docs!

Edited to fix bloody it's/its error. Damned inconsistent language.
 

Back
Top Bottom