added mtime, next version will be 5 - 9base - revived minimalist port of Plan 9 userland to Unix
 (HTM) git clone git://git.suckless.org/9base
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 07cf44e6452f7928fe20cc2849c249b28d19344f
 (DIR) parent 244b935e44cbdc4d361135bf83c083688b943eb4
 (HTM) Author: anselm@garbe.us <unknown>
       Date:   Mon, 22 Mar 2010 08:04:31 +0000
       
       added mtime, next version will be 5
       Diffstat:
         M Makefile                            |       2 +-
         M config.mk                           |       6 +++---
         A mtime/Makefile                      |      11 +++++++++++
         A mtime/mtime                         |       0 
         A mtime/mtime.c                       |      33 +++++++++++++++++++++++++++++++
       
       5 files changed, 48 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       @@ -3,7 +3,7 @@
        include config.mk
        
        SUBDIRS  = lib9 yacc awk basename bc cal cat cleanname date dc du echo grep hoc ls \
       -           mk rc read sed seq sleep sort tee test touch tr troff uniq
       +           mk mtime rc read sed seq sleep sort tee test touch tr troff uniq
        
        all:
                @echo 9base build options:
 (DIR) diff --git a/config.mk b/config.mk
       @@ -4,10 +4,10 @@
        PREFIX      = /usr/local/plan9
        MANPREFIX   = ${PREFIX}/share/man
        
       -VERSION     = 4
       -#OBJTYPE     = 386
       +VERSION     = 5
       +OBJTYPE     = 386
        #OBJTYPE     = arm
       -OBJTYPE     = x86_64
       +#OBJTYPE     = x86_64
        
        # Linux/BSD
        #CFLAGS      += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -c -I. -DPREFIX="\"${PREFIX}\""
 (DIR) diff --git a/mtime/Makefile b/mtime/Makefile
       @@ -0,0 +1,11 @@
       +# mtime - unix port from plan9
       +#
       +# Depends on ../lib9
       +
       +TARG      = mtime
       +
       +include ../std.mk
       +
       +pre-uninstall:
       +
       +post-install:
 (DIR) diff --git a/mtime/mtime b/mtime/mtime
       Binary files differ.
 (DIR) diff --git a/mtime/mtime.c b/mtime/mtime.c
       @@ -0,0 +1,33 @@
       +#include <u.h>
       +#include <libc.h>
       +
       +void
       +usage(void)
       +{
       +        fprint(2, "usage: mtime file...\n");
       +        exits("usage");
       +}
       +
       +void
       +main(int argc, char **argv)
       +{
       +        int errors, i;
       +        Dir *d;
       +
       +        ARGBEGIN{
       +        default:
       +                usage();
       +        }ARGEND
       +
       +        errors = 0;
       +        for(i=0; i<argc; i++){
       +                if((d = dirstat(argv[i])) == nil){
       +                        fprint(2, "stat %s: %r\n", argv[i]);
       +                        errors = 1;
       +                }else{
       +                        print("%11lud %s\n", d->mtime, argv[i]);
       +                        free(d);
       +                }
       +        }
       +        exits(errors ? "errors" : nil);
       +}