diff options
author | Wayne Davison <wayned@samba.org> | 2004-08-09 20:46:54 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2004-08-09 20:46:54 +0000 |
commit | 100b62bb6936c3fb3eea0460885417277b979046 (patch) | |
tree | 5a66f3692e98cd27473dc6dc9d20061324b45aea /getfsdev.c | |
parent | e012b94f21da5dcf2043b3dc967e4723c7ba4b35 (diff) | |
download | rsync-100b62bb6936c3fb3eea0460885417277b979046.tar.gz rsync-100b62bb6936c3fb3eea0460885417277b979046.tar.bz2 rsync-100b62bb6936c3fb3eea0460885417277b979046.zip |
Output a device string for each file given on the command-line.
Diffstat (limited to 'getfsdev.c')
-rw-r--r-- | getfsdev.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; +} |