2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
6 /** Unmounts a volume */
19 usage(const char *programName
)
22 printf("usage: %s [-f] <path to volume>\n"
23 "\t-f\tforces unmounting in case of open files left\n", programName
);
29 main(int argc
, char **argv
)
31 const char *programName
= argv
[0];
37 /* prettify the program name */
39 if (strrchr(programName
, '/'))
40 programName
= strrchr(programName
, '/') + 1;
49 if (!strcmp(++arg
, "f"))
50 flags
|= B_FORCE_UNMOUNT
;
57 /* check the arguments */
62 if (stat(path
, &pathStat
) < 0) {
63 fprintf(stderr
, "%s: The path \"%s\" is not accessible\n", programName
, path
);
69 status
= fs_unmount_volume(path
, flags
);
71 fprintf(stderr
, "%s: unmounting failed: %s\n", programName
, strerror(status
));