Output a device string for each file given on the command-line.
authorWayne Davison <wayned@samba.org>
Mon, 9 Aug 2004 20:46:54 +0000 (20:46 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 9 Aug 2004 20:46:54 +0000 (20:46 +0000)
getfsdev.c [new file with mode: 0644]

diff --git a/getfsdev.c b/getfsdev.c
new file mode 100644 (file)
index 0000000..6ccfceb
--- /dev/null
@@ -0,0 +1,17 @@
+#include "rsync.h"
+
+ int main(int argc, char *argv[])
+{
+       STRUCT_STAT st;
+
+       while (--argc > 0) {
+               if (stat(*++argv, &st) < 0) {
+                       fprintf(stderr, "Unable to stat `%s'\n", *argv);
+                       exit(1);
+               }
+               printf("%ld/%ld\n", (long)major(st.st_dev),
+                                   (long)minor(st.st_dev));
+       }
+
+       return 0;
+}