aboutsummaryrefslogtreecommitdiff
path: root/utime.c
diff options
context:
space:
mode:
Diffstat (limited to 'utime.c')
-rw-r--r--utime.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/utime.c b/utime.c
new file mode 100644
index 0000000..4b7984f
--- /dev/null
+++ b/utime.c
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <sys/time.h>
+#include "scan.h"
+#include "exit.h"
+
+char *fn;
+
+char *ustr;
+unsigned long u;
+time_t ut[2];
+
+int main(int argc,char **argv)
+{
+ fn = argv[1];
+ if (!fn) _exit(100);
+
+ ustr = argv[2];
+ if (!ustr) _exit(100);
+ scan_ulong(ustr,&u);
+
+ ut[0] = ut[1] = u;
+ if (utime(fn,ut) == -1) _exit(111);
+ _exit(0);
+}