Posted on 2004-04-21
Ok... I need a front end for something I'm working on and I don't know how to do it. I need a user to be able to see a tree-view of their harddrive(s) and be able to select and unselect folders and individual files (checkboxes?). When they do this, I need this program that you are writing for me to write to a text file for me to process with Perl (the only language I actually know).
I don't have too many stipulations regarding the output... just that it be complete enough for me to do some logical parsing. Here's an idea:
The highest level folder they select in any given branch is written to a text file with that path
If they DESELECT any folder beneath that, that path gets written and flagged as a deselect
Similarly, every FILE they DESELECT under that high-level folder has its path written and flagged as a deselect.
So, if you picture it, there can be multiple "high level" folders, each with its own set of "exclusions" (for lack of a better word). Here's a diagram demonstrating 2 "high level" folders being selected (1 is not) and some "exclusions"
Cdrive ------ Documents and Settings (selected)
----- Program Files (not selected)
----- Accounting Files (selected)
----- Another Folder (inherits selected)
| ----- Some.File (deselected)
----- Yet Another (deselected)
So this would result in a text file something like this
+ c:\Documents and Settings\
+ c:\Accounting Files\
- c:\Accounting Files\Some.File
- c:\Accounting Files\Yet Another\
c:\program files\ doesn't need to be written because it was never selected in the first place. And c:\Accounting Files\Another Folder\ doesn't need to be written because it is assumed as part of c:\Accounting Files\
Notice the + and - flags. Really, only one or the other need to be there just so I can distinguish.
So to recap:
The highest level selected folder in a tree branch is written to the file
Each directory and File beneath the selected folders that are DEselected are written and flagged.
It doesn't have to be ultra slick, but clean would be nice. And functional... obviously these trees can expand pretty much forever, so the interface needs to accommodate (window sliders?)
Finally, I need it to be an exe... not a vb script cause I wouldn't know what to do with it. I just want to be able to call it from a batch file or Perl, have the user use it, and have their selections output to a text file as described. Even better if it can first read from the text file to reflect their previous choices from a past session - boy that would be worth an extra $10 for sure.
Thanks to anyone that takes the time to look this over. Cheers.