Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 17th, 2007, 02:55 PM
Robert Latest
Guest
 
Posts: n/a
Default Command-line program for pretty dir listings needed

Hello,

if HTML authoring includes HTML autogeneration, this request is on-topic.
Otherwise please forgive me and point me in the right direction.

I'd like to make a bunch of dirs full of files available on a web server. Of
course I could just leave them like they are and have the server take care
of the listings. I don't like that because the listing is entirely
server-dependent, if the server allows dir listings at all. On the server
I'm using the listing is ugly to boot because the server doesn't display
UTF-8 characters correctly; it also doesn't show file sizes and dates.

So what I'm looking for is some little program which, when invoked in a
directory, will produce an index.html file listing the files in that dir,
including date and file size. With a link to the respective file itself of
course.

I could cook up somthing like that myself but I thought, maybe it exists. I
found a couple of PHP scripts that sort of do what I want, but I'd like to
use this method also with local (server-less) file access.

Finally, since I use makefiles to autogenerate my website, the program
should work from the command-line without user intervention. And on Linux.

Suggestions, anyone?

robert
  #2  
Old August 17th, 2007, 03:45 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Command-line program for pretty dir listings needed

Scripsit Robert Latest:
Quote:
if HTML authoring includes HTML autogeneration, this request is
on-topic. Otherwise please forgive me and point me in the right
direction.
It's not about HTML but server-side operations, so c.i.w.a.tools or
c.i.w.a.misc would have been a better choice. This sounds mostly like a
tools question, so I'm sending this to c.i.w.a.tools too and setting
followups there.
Quote:
I'd like to make a bunch of dirs full of files available on a web
server. Of course I could just leave them like they are and have the
server take care of the listings. I don't like that because the
listing is entirely server-dependent, if the server allows dir
listings at all.
That's true, but the situation is server-dependent anyway (unless you do
preprocessing: generate the listing yourself and upload it whenever you make
a change to the collection of files). If you use, say, PHP to generate the
listing, then you would have to change something if you move the site to a
system where PHP is not allowed.
Quote:
On the server I'm using the listing is ugly to boot
because the server doesn't display UTF-8 characters correctly; it
also doesn't show file sizes and dates.
Well, that's a good enough reason to something about it. However, it's not
certain that existing software for your purposes will do UTF-8 either.
Quote:
So what I'm looking for is some little program which, when invoked in
a directory, will produce an index.html file listing the files in
that dir, including date and file size. With a link to the respective
file itself of course.
You get more challenges (and, if successful, better results) if you use
short codes or icons that indicate the type of each file (like DOC, GIF
etc.), if there are different types.
Quote:
Finally, since I use makefiles to autogenerate my website, the program
should work from the command-line without user intervention. And on
Linux.
Oh, then you're doing preprocessing, and you have different options. I'm
pretty sure there are utilities for your purposes, but writing a suitable
one might be easier than finding a suitable one. :-) Sounds like a job for
Perl.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

  #3  
Old August 17th, 2007, 04:25 PM
Andreas Prilop
Guest
 
Posts: n/a
Default Re: Command-line program for pretty dir listings needed

On Fri, 17 Aug 2007, Robert Latest wrote:
Quote:
I'd like to make a bunch of dirs full of files available on a web server.
Address (URL)? Which server software?
Quote:
I'm using the listing is ugly to boot because the server doesn't display
UTF-8 characters correctly;
You must use "percent encoding" by RFC 3986.
http://www.unics.uni-hannover.de/nhtcapri/%25/
Quote:
So what I'm looking for is some little program which, when invoked in a
directory, will produce an index.html file listing the files in that dir,
including date and file size. With a link to the respective file itself of
course.
Apache can do this for you.
http://httpd.apache.org/docs/1.3/mod/mod_autoindex.html
  #4  
Old August 17th, 2007, 05:55 PM
David E. Ross
Guest
 
Posts: n/a
Default Re: Command-line program for pretty dir listings needed

On 8/17/2007 6:49 AM, Robert Latest wrote:
Quote:
Hello,
>
if HTML authoring includes HTML autogeneration, this request is on-topic.
Otherwise please forgive me and point me in the right direction.
>
I'd like to make a bunch of dirs full of files available on a web server. Of
course I could just leave them like they are and have the server take care
of the listings. I don't like that because the listing is entirely
server-dependent, if the server allows dir listings at all. On the server
I'm using the listing is ugly to boot because the server doesn't display
UTF-8 characters correctly; it also doesn't show file sizes and dates.
>
So what I'm looking for is some little program which, when invoked in a
directory, will produce an index.html file listing the files in that dir,
including date and file size. With a link to the respective file itself of
course.
>
I could cook up somthing like that myself but I thought, maybe it exists. I
found a couple of PHP scripts that sort of do what I want, but I'd like to
use this method also with local (server-less) file access.
>
Finally, since I use makefiles to autogenerate my website, the program
should work from the command-line without user intervention. And on Linux.
>
Suggestions, anyone?
>
robert
Go to my home page (per my signature below). Scroll to the bottom.
Select "Index of HTML Files". Is this something similar to what you want?

--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
  #5  
Old August 20th, 2007, 02:25 PM
Robert Latest
Guest
 
Posts: n/a
Default Re: Command-line program for pretty dir listings needed

["Followup-To:" header set to comp.infosystems.www.authoring.html.]
Andreas Prilop wrote:
Quote:
On Fri, 17 Aug 2007, Robert Latest wrote:
>
Quote:
>I'd like to make a bunch of dirs full of files available on a web server.
>
Address (URL)? Which server software?
Doesn't matter because it needs to be portable across servers.
Quote:
Apache can do this for you.
http://httpd.apache.org/docs/1.3/mod/mod_autoindex.html
Maybe it can; however, the page is served by unknown software from
inaccessible hardware.

robert
  #6  
Old August 20th, 2007, 02:25 PM
Robert Latest
Guest
 
Posts: n/a
Default Re: Command-line program for pretty dir listings needed

Michael Stemper wrote:
Quote:
#!/bin/ksh
# Index generator
[...]

Yeah, I've written a similar shell script (even simpler; it doesn't look
into the HTML because I'm mostly serving PDFs).

robert
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles