summaryrefslogtreecommitdiff
path: root/src/cmd/mv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/mv.c')
-rw-r--r--src/cmd/mv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cmd/mv.c b/src/cmd/mv.c
new file mode 100644
index 0000000..e7bcc46
--- /dev/null
+++ b/src/cmd/mv.c
@@ -0,0 +1,17 @@
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+int
+main(int argc, const char *argv[])
+{
+ if (argc != 3) {
+ fprintf(stderr, "usage: mv from to\n");
+ return 1;
+ }
+
+ if (rename(argv[1], argv[2]) < 0) {
+ fprintf(stderr, "mv: %s\n", strerror(errno));
+ return 1;
+ }
+}