Subject: tree v1.3 ported to cygwin
From: "Gerrit P. Haase" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>, <[email-masked]>
Date: Wed, 13 Jun 2001 15:17:55 +0200

Hi, 

i've build tree-1.3 on cygwin, nice tool (tree-ware;)
HTML-output is hyperlinked for use with webservers!

http://freshmeat.net/projects/tree/
ftp://mama.indstate.edu/linux/tree/

==========
Bugreport:
==========
Options -A and -S (ANSI & ASCII graphics) seems not to work for me
on cygwin, output is then: 
$ tree -dDCA
.
tqq [Jun 13 12:45]  bin
tqq [Jun 13 12:45]  conf
mqq [Jun 13 12:45]  src
$ tree -dDCS
.
ÃÄÄ[Jun 13 12:45]  bin
ÃÄÄ[Jun 13 12:45]  conf
ÀÄÄ[Jun 13 12:45]  src

If 'baseHREF' is '/' then the generated hyperlinks are wrong, they
point to 'http://file.html' (see demo-output below). tree needs to
be invoked with a full URI ( -H http://localhost:8080) and makes only
correct hyperlinks to view with a webserver.
If HTML-Output is redirected to a file, there are some control-characters
included from coloring, which aren't there if output goes direct to the 
terminal...well, then there are the colors.
It works if invoked with -n && !-C (see short help below): 
$ tree -nH /localhost -o file.html

Looks like this if redirected with '>' or '-o' and invoked with -C:
===================================================================
Directory Tree
/ [01;34m[00m 
   |-- [Jun 7 12:26]  [01;34mbin/[00m 
   |-- [Jun 7 12:26]  [01;34mconf/[00m 
   |-- [Jun 13 11:35]  [01;34mhtdocs/[00m 
   ·-- [Jun 7 12:26]  [01;34msrc/[00m 

4 directories 

===========
Short help:
===========
$ tree --help
usage: tree [-adfgilnpqstuxACDFNS] [-H baseHREF] [-L level [-R]] [-P pattern]
        [-I pattern] [-o filename] [--version] [--help] [<directory list>]
    -a          All files are listed.
    -d          List directories only.
    -l          Follow symbolic links like directories.
    -f          Print the full path prefix for each file.
    -i          Don't print indentation lines.
    -q          Print non-printable characters as '?'.
    -N          Print non-printable characters as is.
    -p          Print the protections for each file.
    -u          Displays file owner or UID number.
    -g          Displays file group owner or GID number.
    -s          Print the size in bytes of each file.
    -D          Print the date of last modification.
    -F          Appends '/', '=', '*', or '|' as per ls -F.
    -t          Sort files by last modification time.
    -x          Stay on current filesystem only.
    -L level    Descend only level directories deep.
    -A          Print ANSI lines graphic indentation lines.
    -S          Print with ASCII graphics identation lines.
    -n          Turn colorization off always (-C overrides).
    -C          Turn colorization on always.
    -P pattern  List only those files that match the pattern given.
    -I pattern  Do not list files that match the given pattern.
    -H baseHREF Prints out HTML format with baseHREF as top directory.
    -R          Rerun tree when max dir level reached.
    -o file     output to file instead of stdout.

=======================
Demo (colored output:):
=======================
$ tree -dDC
.
|-- [Jun  7 12:26]  bin
|-- [Jun  7 12:26]  conf
|-- [Jun  7 12:26]  htdocs
`-- [Jun  7 12:26]  src

4 directories

$ tree -DC
.
|-- [Jun  7 12:26]  BUGS
|-- [Jun  7 12:26]  Changelog
|-- [Jun  7 12:26]  Install~
|-- [Jun  7 12:26]  Makefile
|-- [Jun  7 12:26]  README.es
|-- [Jun  7 12:26]  bin
|   `-- [Jun  7 12:26]  monkey.exe
|-- [Jun  7 12:26]  conf
|   |-- [Jun  7 12:26]  mime.types
|   `-- [Jun  7 12:26]  monkey.conf
|-- [Jun  7 12:26]  htdocs
|   |-- [Jun  7 12:26]  404.html
|   |-- [Jun  7 12:26]  405.html
|   `-- [Jun  7 12:26]  index.html
`-- [Jun  7 12:26]  src
    |-- [Jun  7 12:26]  config.h
    |-- [Jun  7 12:26]  method.h
    |-- [Jun  7 12:26]  mimetype.h
    |-- [Jun  7 12:26]  monkey.c
    |-- [Jun  7 12:26]  request.h
    `-- [Jun  7 12:26]  version.h

4 directories, 17 files

$ tree -dDCH /
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Made by 'tree'">
<META NAME="GENERATOR" CONTENT="Linux">
</HEAD>
<BODY>
<H1><BR>Directory Tree</H1>
<FONT FACE="Courier New,Courier">
<A HREF="/">/</A>

<BR>&nbsp;&nbsp;&nbsp;|-- [Jun  7 12:26]&nbsp;&nbsp;<A HREF="//bin/">bin/</A>
<BR>&nbsp;&nbsp;&nbsp;|-- [Jun  7 12:26]&nbsp;&nbsp;<A HREF="//conf/">conf/</A>
<BR>&nbsp;&nbsp;&nbsp;|-- [Jun  7 12:26]&nbsp;&nbsp;<A HREF="//htdocs/">htdocs/</A>
<BR>&nbsp;&nbsp;&nbsp;&middot;-- [Jun  7 12:26]&nbsp;&nbsp;<A HREF="//src/">src/</A>
<BR><BR>
4 directories
</FONT>
<BR><BR>
<HR WIDTH="35%" ALIGN="LEFT">
<FONT FACE="Arial, Helvetica">
tree v1.3 © 1996 - 1999 by Steve Baker and Thomas Moore<BR>
HTML output hacked and copyleft © 1998 by Francesc Rocher<BR>
This software is experimental. Send commends and/or<BR>
suggestions to <A HREF="mailto:[email-masked]">[email-masked]</A>
</FONT>
</BODY>
</HTML>

===========================
Patch (not really a patch):
===========================
$ diff -urw tree-1.3 tree-1.3-cygwin
diff -urw tree-1.3/Makefile tree-1.3-cygwin/Makefile
--- tree-1.3/Makefile   Mon Dec 11 19:43:23 2000
+++ tree-1.3-cygwin/Makefile    Wed Jun 13 11:06:08 2001
@@ -10,8 +10,9 @@
 CFLAGS=-O2 -Wall -fomit-frame-pointer #-m486
 LDFLAGS=-s
 
+EXEEXT=.exe
 VERSION=1.3
-TREE_DEST=tree
+TREE_DEST=tree$(EXEEXT)
 BINDIR=/usr/local/bin
 MAN=tree.1
 MANDIR=/usr/man/man1

============PATCH END.

-gph

-- 
Gerrit P. Haase

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple