473,225 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

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
Aug 17 '07 #1
5 2307
Scripsit Robert Latest:
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.
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.
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.
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.
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/

Aug 17 '07 #2
On Fri, 17 Aug 2007, Robert Latest wrote:
I'd like to make a bunch of dirs full of files available on a web server.
Address (URL)? Which server software?
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/
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
Aug 17 '07 #3
On 8/17/2007 6:49 AM, Robert Latest wrote:
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.
Aug 17 '07 #4
["Followup-To:" header set to comp.infosystems.www.authoring.html.]
Andreas Prilop wrote:
On Fri, 17 Aug 2007, Robert Latest wrote:
>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.
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
Aug 20 '07 #5
Michael Stemper wrote:
#!/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
Aug 20 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hugh Macdonald | last post by:
I'm calling a command from within a python script and I need to be able to both catch the output (stdout and stderr) from it and also have the PID (so that I can kill it) I can do one or other...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
8
by: Charles Law | last post by:
I am implementing the command pattern in VB.NET, where the commands have been serialised. That is, I have several classes that all inherit from my base Command class, that implements ICommand...
2
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
4
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
3
by: Michael Roebuck | last post by:
Hi all I'm very new to VB - I am trying to run a DOS command from within a VB2005 asp.net web site using a command button? The DOS command will take the form of the command followed by several...
2
by: luanhoxung | last post by:
Hi, Folks Please show me what happen ? In my Code, I declare: cm as command the word "command" doesnot capital the first letter like : Command. And i think VBA doesnot know what is cm ?? But in...
0
by: czerwww | last post by:
Can someone please help me? I have class for database connection and I need set command.commandTimeout. How can I do that? Code: Imports System.Data.SqlClient Imports System.Data Public Class...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.