2 * Program for determining file system type
4 * Written by Preben 'Peppe' Guldberg, December MMIV
11 Copyright (C) 2004 Kern Sibbald
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of
16 the License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public
24 License along with this program; if not, write to the Free
25 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
31 #include "findlib/find.h"
37 "Usage: fstype [-d debug_level] path ...\n"
39 " Print the file system type a given file/directory is on.\n"
40 " The following options are supported:\n"
42 " -v print both path and file system type.\n"
43 " -? print this message.\n"
51 main (int argc, char *const *argv)
58 while ((ch = getopt(argc, argv, "v?")) != -1) {
76 for (i = 0; i < argc; --argc, ++argv) {
77 if ((fs = fstype(*argv)) != NULL) {
79 printf("%s: %s\n", *argv, fs);
85 fprintf(stderr, "%s: unknown\n", *argv);