Whamcloud - gitweb
Add mrename program to avoid GNU "mv" changing args and doing lstat.
authoradilger <adilger>
Thu, 25 Sep 2003 08:57:57 +0000 (08:57 +0000)
committeradilger <adilger>
Thu, 25 Sep 2003 08:57:57 +0000 (08:57 +0000)
lustre/tests/mrename.c [new file with mode: 0644]

diff --git a/lustre/tests/mrename.c b/lustre/tests/mrename.c
new file mode 100644 (file)
index 0000000..1c18880
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+       int rc;
+
+       if (argc != 3) {
+               fprintf(stderr, "usage: %s from to\n", argv[0]);
+               exit(1);
+       }
+
+       rc = rename(argv[1], argv[2]);
+       printf("rename returned %d: %s\n", rc, strerror(errno));
+
+       return rc;
+}