From 100b62bb6936c3fb3eea0460885417277b979046 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 9 Aug 2004 20:46:54 +0000 Subject: Output a device string for each file given on the command-line. --- getfsdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 getfsdev.c (limited to 'getfsdev.c') diff --git a/getfsdev.c b/getfsdev.c new file mode 100644 index 00000000..6ccfceb3 --- /dev/null +++ b/getfsdev.c @@ -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; +} -- cgit v1.2.3