473,656 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2332
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.infosystem s.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
3698
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 of these, but I can't find any way to do them both at the same time. So far, I've got the following options:
8
1333
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 newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
8
1710
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 (standard stuff). The commands, however, are deserialised at runtime, so the idea of passing a receiver in the constructor does not work in this case. In addition, I am implementing the MacroCommand extension, and each command in a macro could...
2
6668
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 sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim command As String command = "systeminfo > C:\temp\sysinfo.txt"
4
2871
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 for you. This one is pretty straight forward. In the Command Pattern an object encapsulates everything needed to execute a method in another object. http://www.fluffycat.com/SDCMSv2/PHP-Design-Patterns-Command/
14
4960
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 for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
3
4841
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 switches! Any ideas examples gratefully accepted.
2
1487
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 my office, i can see: cm as Command, and everything do as my intent (cm is a Command)--->Why ? Please give me a hand. thanks in advance. Luan from VietNam
0
1699
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 Db Private Shared _ConnString As String = "" Private Shared _Connection As SqlConnection Public Shared Sub SetConnectionString(ByVal connString As String)
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.