aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/mtime.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-21 23:22:06 +0000
committerrsc <devnull@localhost>2004-04-21 23:22:06 +0000
commit17e5fb8973d9e48ef53a88eb78f845f8a7b41a5b (patch)
tree921c649de0d83bdde4561f5868e5ff3ab9986af8 /src/cmd/mtime.c
parent3e63e5c271f7a7013dc4b3fedfb83c2d547b8c26 (diff)
downloadplan9port-17e5fb8973d9e48ef53a88eb78f845f8a7b41a5b.tar.gz
plan9port-17e5fb8973d9e48ef53a88eb78f845f8a7b41a5b.tar.bz2
plan9port-17e5fb8973d9e48ef53a88eb78f845f8a7b41a5b.zip
add new guys
Diffstat (limited to 'src/cmd/mtime.c')
-rw-r--r--src/cmd/mtime.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cmd/mtime.c b/src/cmd/mtime.c
new file mode 100644
index 00000000..db5ea490
--- /dev/null
+++ b/src/cmd/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);
+}