Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sortable table of directory details

Posted on 2002-05-27
5
Medium Priority
?
185 Views
Last Modified: 2013-12-25
I want to be able to display details of a directory as a  HTML table. Columns would include file name, size, date modified etc. I would then like to allow the user to sort by a column, say size or date in ascending or descending order. I guess this means a CGI form. As this seems like a common task, I REALLY want to use some sort of tool or module., not program from scratch. I have looked at HTML::Table and CGI::FormBuilder. Any recommendations?
0
Comment
Question by:Kim Ryan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:samri
ID: 7038390
I doesn't seem to see any module to do that yet.  

But it can be achieved with a combination of
Modules - HTML::Table, File::List
Function - opendir, readdir, stat, sort

and of course, you might need Perl.

What is you OS, and webserver platform btw?




0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 7038394
Am using Linux and perl. I already have the code to build the file stats, problem is just with presentation. I noticed that some directory listings like CPAN have a column heading you can click and the table resorts itself by that field. For example:

http://www.cpan.org/modules/by-module/Apache/BARRACODE/
has a HREF in the size column
http://www.cpan.org/modules/by-module/Apache/BARRACODE/?S=A
click it and you get results sorted by size ascending. Click it again (the HREF is now ?S=D) and it descends. Is this handled by the server, ie some httpd.conf setting for directory browsing?
0
 
LVL 15

Accepted Solution

by:
samri earned 800 total points
ID: 7038410
Yes, it was apache that does that.  Take a look at mod_autoindex http://httpd.apache.org/docs/mod/mod_autoindex.html

and make sure that the Directory directive is configured to allow directory browsing.  By default Apache is restrictive as not to allow dir browsing.

You can give it a try.

Alias /test "/somewhere/path"
<Directory "/somewhere/path">
     Options Indexes Multiviews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

good luck.
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 7038595
Thanks, I think I will just have to use perl to do some custom sorting
0
 
LVL 15

Expert Comment

by:samri
ID: 7038612
no. prob.,
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question