Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear sisters and brothers in PERL,
for my applications I am looking for both a pure directory selection and a mixed fie and directory selection in PERL/Tk. There are a number of example programs available in the net, and I tried some of them, but I didn't find any which does exactly what I want to have. So I would like to ask you for help to find such an example program. One of the examples for a directory selection tree I found and which I like is from Slaven Resic, located at http://www.perltk.org/files/dirtree.pl.txt:
It does more or less what I want it to do, only that it displays the directory tree of one drive only, and I want to have a directory tree displaying all of the drives which are in use, both hard discs and rather temporary device like USB sticks. In an ideal situation the directory tree starts with a display of all drives (c:, d:, etc.) with the highest level of directorys, from which people then can click down to the folder they want to select. With a slight modification of the above mentioned example program I almost get that: if I replace the line$d->chdir($curr_dir); through
I'll have all of the trees available, albeit the drive from which the program is started doesn't look exactly the way I described above, but opens to the directory in which the program is located. I could live with this situation, but a more dynamic display through a program linefor (my $i=0;$i<=$#drives;++$i) { $d->chdir($drives[$i); } (in which the @drives list contains all active drives, eg. estimated through an analysing function) didn't work, and I couldn't find the reason why. So, once again, my questions:Where can I find any example program which creates me a file and directory selection tool which is able to display the entire directory structure of a computer instead of just the structure for one drive only? and/or How can I modify the above mentioned program to show this entire drive and directory structure (built from a drive list) without hard coding the drives available on the computer? Many thanks for your help, best greetings and wishes, Yours chanklaus! Amen!
Learning is like swimming against the current - as soon as you stop you'll drift back (Chinese proverb) In reply to Directory and file selection with PERL/Tk by chanklaus
|
|