sgt/agedu
15 years agoFix bonehead error in hex escape processing when loading dump files.
simon [Sun, 2 Nov 2008 13:05:17 +0000 (13:05 +0000)]
Fix bonehead error in hex escape processing when loading dump files.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8256 cda61777-01e9-0310-a592-d414129be87e

15 years agoInvent a cunning means of faking plausible atimes for directories,
simon [Sun, 2 Nov 2008 13:00:59 +0000 (13:00 +0000)]
Invent a cunning means of faking plausible atimes for directories,
since directories will tend to have been accessed constantly by
other recursive disk scans and hence not really reflect the semantic
last-usage status of the stuff within them. Directories' atimes are
now computed as the maximum of their mtime and all the atimes below
them. (There's a command-line option to revert to the obvious
behaviour, but I think it is not in general the most useful thing.)

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8255 cda61777-01e9-0310-a592-d414129be87e

15 years agoReposition r8253's change to avoid redundant index lookups.
simon [Sun, 2 Nov 2008 11:35:08 +0000 (11:35 +0000)]
Reposition r8253's change to avoid redundant index lookups.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8254 cda61777-01e9-0310-a592-d414129be87e

15 years agoNearly forgot: leave out individual files in the text display.
simon [Sun, 2 Nov 2008 11:00:28 +0000 (11:00 +0000)]
Nearly forgot: leave out individual files in the text display.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8253 cda61777-01e9-0310-a592-d414129be87e

15 years agoCentralise the program name into the main header file. I'm probably
simon [Sun, 2 Nov 2008 10:41:57 +0000 (10:41 +0000)]
Centralise the program name into the main header file. I'm probably
not planning to change it any more, but it seems generally more
sensible to keep it in one place just in case.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8252 cda61777-01e9-0310-a592-d414129be87e

15 years agoProbably about time I had a central header file containing misc stuff.
simon [Sun, 2 Nov 2008 10:35:18 +0000 (10:35 +0000)]
Probably about time I had a central header file containing misc stuff.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8251 cda61777-01e9-0310-a592-d414129be87e

15 years agoTurn my disgusting readdir macros into a reasonably clean function
simon [Sun, 2 Nov 2008 09:47:45 +0000 (09:47 +0000)]
Turn my disgusting readdir macros into a reasonably clean function
call interface. In the immediate short term this permits me to cope
when open(...,O_NOATIME) returns EPERM; in the longer term it should
also allow me to drop in other readdir mechanisms more easily,
perhaps including Windows.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8250 cda61777-01e9-0310-a592-d414129be87e

15 years agoAbout time I put a licence on this. MIT as usual, naturally.
simon [Sat, 1 Nov 2008 17:44:55 +0000 (17:44 +0000)]
About time I put a licence on this. MIT as usual, naturally.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8249 cda61777-01e9-0310-a592-d414129be87e

15 years agoReorder the plain text output so that the roots are at the bottom,
simon [Sat, 1 Nov 2008 17:42:41 +0000 (17:42 +0000)]
Reorder the plain text output so that the roots are at the bottom,
since it's mostly there for people who like reading standard du
output. Also, add a configurable recursion depth option.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8248 cda61777-01e9-0310-a592-d414129be87e

15 years agoNow every action is encapsulated as a command-line option and its
simon [Sat, 1 Nov 2008 17:30:46 +0000 (17:30 +0000)]
Now every action is encapsulated as a command-line option and its
argument, introduce the possibility of doing more than one such
action in the same run. In particular, this means you can do a scan
and immediately launch a web server, which I suspect will be a
popular mode of use.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8247 cda61777-01e9-0310-a592-d414129be87e

15 years agoMinor tweaks: turn the "http://address:port/0" URL of the topmost
simon [Sat, 1 Nov 2008 17:21:47 +0000 (17:21 +0000)]
Minor tweaks: turn the "address:port/0" URL of the topmost
directory in the index into the natural "http://address:port/", and
also stop putting a self-link on the top-level page if the pathname
involved is "/".

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8246 cda61777-01e9-0310-a592-d414129be87e

15 years agoFix the various issues centring around the anomaly in Unix pathname
simon [Sat, 1 Nov 2008 17:05:32 +0000 (17:05 +0000)]
Fix the various issues centring around the anomaly in Unix pathname
syntax that the canonical name of "/" ends in a trailing '/'.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8245 cda61777-01e9-0310-a592-d414129be87e

15 years agoFix gormlessness in html.c introduced in r8241.
simon [Sat, 1 Nov 2008 16:34:29 +0000 (16:34 +0000)]
Fix gormlessness in html.c introduced in r8241.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8244 cda61777-01e9-0310-a592-d414129be87e

15 years ago--scan-dump and --load options, for moving dump files around and
simon [Sat, 1 Nov 2008 16:32:26 +0000 (16:32 +0000)]
--scan-dump and --load options, for moving dump files around and
rebuilding index files.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8243 cda61777-01e9-0310-a592-d414129be87e

15 years agoChange the index file format to explicitly indicate the appropriate
simon [Sat, 1 Nov 2008 16:01:10 +0000 (16:01 +0000)]
Change the index file format to explicitly indicate the appropriate
path separator.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8242 cda61777-01e9-0310-a592-d414129be87e

15 years agoPrepare to have a parametrisable path separator character. Currently
simon [Sat, 1 Nov 2008 15:52:16 +0000 (15:52 +0000)]
Prepare to have a parametrisable path separator character. Currently
the value of 'pathsep' never changes, but the code should now be
ready to cope when it does.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8241 cda61777-01e9-0310-a592-d414129be87e

15 years agoMore HTTP server configuration: allow user-chosen address+port and
simon [Sat, 1 Nov 2008 15:21:40 +0000 (15:21 +0000)]
More HTTP server configuration: allow user-chosen address+port and
HTTP Basic authentication data.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8240 cda61777-01e9-0310-a592-d414129be87e

15 years agoConfigurable age range represented by the colour coding in the HTML
simon [Sat, 1 Nov 2008 14:49:32 +0000 (14:49 +0000)]
Configurable age range represented by the colour coding in the HTML
output.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8239 cda61777-01e9-0310-a592-d414129be87e

15 years agoFilter literally-zero-size directories out of the display, since
simon [Sat, 1 Nov 2008 10:53:33 +0000 (10:53 +0000)]
Filter literally-zero-size directories out of the display, since
they typically arise from --exclude-path.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8238 cda61777-01e9-0310-a592-d414129be87e

15 years agoProtect against division by zero when handling directories with
simon [Sat, 1 Nov 2008 10:45:39 +0000 (10:45 +0000)]
Protect against division by zero when handling directories with
total size of zero.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8237 cda61777-01e9-0310-a592-d414129be87e

15 years agoAdd --prune as an alternative to --exclude, the difference being
simon [Sat, 1 Nov 2008 10:36:36 +0000 (10:36 +0000)]
Add --prune as an alternative to --exclude, the difference being
that excluding a directory still scans its contents whereas pruning
one chops its entire branch out of the directory tree.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8236 cda61777-01e9-0310-a592-d414129be87e

15 years agoFold some brief and inadequate online help into the ghastly command
simon [Sat, 1 Nov 2008 10:25:46 +0000 (10:25 +0000)]
Fold some brief and inadequate online help into the ghastly command
line macros.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8235 cda61777-01e9-0310-a592-d414129be87e

15 years agoCentralise command-line option definitions, using disgusting macros
simon [Sat, 1 Nov 2008 09:40:36 +0000 (09:40 +0000)]
Centralise command-line option definitions, using disgusting macros
just out of curiosity to see how well they work for the job.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8234 cda61777-01e9-0310-a592-d414129be87e

15 years agoStop having a default action mode. All actions now require a
simon [Fri, 31 Oct 2008 19:30:15 +0000 (19:30 +0000)]
Stop having a default action mode. All actions now require a
specific option to enable them.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8233 cda61777-01e9-0310-a592-d414129be87e

15 years agoAdditional options to control the disk scanning: wildcard-based
simon [Thu, 30 Oct 2008 20:08:07 +0000 (20:08 +0000)]
Additional options to control the disk scanning: wildcard-based
includes and excludes, control of the cross-fs-boundary prohibition.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8230 cda61777-01e9-0310-a592-d414129be87e

15 years agoTidy up the reporting of the disk scan progress on standard error.
simon [Thu, 30 Oct 2008 19:41:47 +0000 (19:41 +0000)]
Tidy up the reporting of the disk scan progress on standard error.
It's now conditional by default on stderr being a tty; it's
configurable on or off manually if necessary; and the terminal width
is obtained by TIOCGWINSZ instead of by guesswork.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8229 cda61777-01e9-0310-a592-d414129be87e

15 years agoIntroduce something more like an actual framework for httpd
simon [Thu, 30 Oct 2008 19:32:25 +0000 (19:32 +0000)]
Introduce something more like an actual framework for httpd
authentication. We now support magic /proc/net auth, HTTP Basic
auth, and no auth; a command-line switch chooses between those three
or the fourth default choice of falling back from /proc/net to Basic.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8228 cda61777-01e9-0310-a592-d414129be87e

15 years agoHTML-escaping mode is bound to come in handy.
simon [Wed, 29 Oct 2008 22:41:51 +0000 (22:41 +0000)]
HTML-escaping mode is bound to come in handy.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8226 cda61777-01e9-0310-a592-d414129be87e

15 years agoSome ignores.
simon [Wed, 29 Oct 2008 21:09:17 +0000 (21:09 +0000)]
Some ignores.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8225 cda61777-01e9-0310-a592-d414129be87e

15 years agoInitial commit of a basically working but severely unpolished
simon [Wed, 29 Oct 2008 21:08:11 +0000 (21:08 +0000)]
Initial commit of a basically working but severely unpolished
utility which does "du" only more usefully: its key feature is that
it breaks down your disk space usage simultaneously by subdirectory
and by atime, so that you can identify large chunks of data which
are simply gathering dust.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@8224 cda61777-01e9-0310-a592-d414129be87e