~ubuntu-branches/ubuntu/saucy/9base/saucy

« back to all changes in this revision

Viewing changes to mtime/mtime.c

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry, Daniel Baumann, Kai Hendry
  • Date: 2010-04-25 14:35:21 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100425143521-ublpgnlvxxjjr22s
Tags: 1:5-1
[ Daniel Baumann ]
* Adding explicit debian source version 1.0 until switch to 3.0.
* Updating year in copyright file.
* Updating to standards 3.8.4.
* Sorting dh call in rules to more common order.
* Updating README.source.
* Updating lintian overrides.

[ Kai Hendry ]
* Merging upstream version 5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <u.h>
 
2
#include <libc.h>
 
3
 
 
4
void
 
5
usage(void)
 
6
{
 
7
        fprint(2, "usage: mtime file...\n");
 
8
        exits("usage");
 
9
}
 
10
 
 
11
void
 
12
main(int argc, char **argv)
 
13
{
 
14
        int errors, i;
 
15
        Dir *d;
 
16
 
 
17
        ARGBEGIN{
 
18
        default:
 
19
                usage();
 
20
        }ARGEND
 
21
 
 
22
        errors = 0;
 
23
        for(i=0; i<argc; i++){
 
24
                if((d = dirstat(argv[i])) == nil){
 
25
                        fprint(2, "stat %s: %r\n", argv[i]);
 
26
                        errors = 1;
 
27
                }else{
 
28
                        print("%11lud %s\n", d->mtime, argv[i]);
 
29
                        free(d);
 
30
                }
 
31
        }
 
32
        exits(errors ? "errors" : nil);
 
33
}