12 @ oct

My patch for lstree, a nice tool that display files and directories in a tree view

lstree displays files and directories as a tree, as pstree does with processes.

It can be found here: Original lstree for Unix and Windows

I've hacked this tool to fit my needs. Improvement:

  • Use the gnu_getcwd() wrapper, instead of getcwd(NULL, 0), that caused segfaults on FreeBSD
  • HTML generation: tags are now lowercase (what an improvement ! :p)
  • HTML generation with or without images, and icons path can be an environement variable
  • new option to take care of “hidden files”:
    • Files or directories beginning by a dot are ignored by default
    • -c option enable “hidden files” support

I really wanted this option because I use this software when programming/writting files in a subversion working directory (and i don’t want to see .svn dirs)

The patch can be downloaded here
and can be applied with:

user@host path/to/lstree/sources$ patch -p1 < /path/to/patch

Demo

Demo of my patched lstree:

Softwares/
  +-- 404_error_page_in_shell.html
  +-- 404_error_page_with_a_CGI_shell_script.html
  +-- 404_error_page_with_a_CGI_shell_script.md
  +-- Hacked_genosite.html
  +-- Hacked_genosite.md
  +-- Hacked_lstree.html
  +-- Hacked_lstree.md
  +-- Hacked_lstree.sosh
  +-- Perfect_console_session.html
  +-- Perfect_console_session.md
  +-- Postfix,_SQLite_&_FreeBSD.html
  +-- Postfix,_SQLite_&_FreeBSD.md
  +-- Postfix,_SQLite_&_FreeBSD.sosh
  +-- RSS_feed_in_shell.html
  +-- RSS_feed_with_a_CGI_shell_script.html
  +-- RSS_feed_with_a_CGI_shell_script.md
  +-- RSS_feed_with_a_CGI_shell_script.sosh
  +-- This_website.html
  +-- This_website.md
  +-- XML_sitemap_in_shell.html
  +-- XML_sitemap_with_a_CGI_shell_script.html
  +-- XML_sitemap_with_a_CGI_shell_script.md
  +-- XML_sitemap_with_a_CGI_shell_script.sosh
  +-- hacked_genosite.html
  +-- index.html
  +-- index.md
  +-- irssi.html
  +-- irssi.md