Permalink
Browse files

o README demo tweaking

o Report if we get broken paths.
  • Loading branch information...
1 parent df18f63 commit cf1b0e0927b6906617119176b1b7fdb46ac320c0 @hzeller committed Sep 23, 2012
Showing with 30 additions and 8 deletions.
  1. +14 −5 README.md
  2. +16 −3 folve-main.cc
View
@@ -71,27 +71,36 @@ This project is notably based on
### Run ###
Folve requires at least two parameters: the directory where your original
*.flac files reside and the mount point of this filesystem.
+
Also, do be useful, you need to supply at least one configuration directory
with the -c <config-dir> option. Very useful is the -p <port> that starts
an HTTP status server. Let's use some example filters from this distribution;
if you are in the folve source directory, you find the directory `demo-filters/`
-that contains subdirectories with filters. Let's choose the lowpass and highpass
-filter to play with:
+that contains subdirectories with filters.
+Let's choose the lowpass and highpass filter to play with:
- $ mkdir /tmp/test-mount
- $ folve -c demo-filters/lowpass -c demo-filters/highpass -p 17322 \
+ $ mkdir /tmp/test-mount
+ $ ./folve -c demo-filters/lowpass -c demo-filters/highpass -p 17322 -f \
/path/to/your/directory/with/flacs /tmp/test-mount
Now you can access the fileystem under that mount point; it has the same
structure as under your `/path/to/your/directory/with/flacs`
- mplayer /tmp/test-mount/foo.flac
+ $ mplayer /tmp/test-mount/foo.flac
Folve provides a HTTP status page; have a look at
http://localhost:17322/
(or whatever port you chose)
+There you can switch the filter - change it and re-open the same flac file:
+you'll hear the difference.
+
+To finish this instance of folve, you can just press CTRL-C as we've run it in
+the foreground (the `-f` option did this). In real life, you'd run it as daemon
+(without `-f` option), so then you can unmount with the `fusermount` command:
+
+ $ fusermount -u /tmp/test-mount
### Filter Configuration ###
The configuration directory should contain configuration files as they're
View
@@ -226,7 +226,13 @@ int FolveOptionHandling(void *data, const char *arg, int key,
case FUSE_OPT_KEY_NONOPT:
// First non-opt: our underlying dir.
if (rt->fs->underlying_dir().empty()) {
- rt->fs->set_underlying_dir(realpath(arg, realpath_buf));
+ const char *base_dir = realpath(arg, realpath_buf);
+ if (base_dir != NULL) {
+ rt->fs->set_underlying_dir(base_dir);
+ } else {
+ fprintf(stderr, "Invalid base path '%s': %s\n",
+ arg, strerror(errno));
+ }
return 0; // we consumed this.
} else {
rt->mount_point = strdup(arg); // remmber as FYI
@@ -238,9 +244,16 @@ int FolveOptionHandling(void *data, const char *arg, int key,
case FOLVE_OPT_REFRESH_TIME:
rt->refresh_time = atoi(arg + 2); // strip "-r"
return 0;
- case FOLVE_OPT_CONFIG:
- rt->fs->add_config_dir(realpath(arg + 2, realpath_buf)); // strip "-c"
+ case FOLVE_OPT_CONFIG: {
+ const char *config_dir = realpath(arg + 2, realpath_buf); // strip "-c"
+ if (config_dir != NULL) {
+ rt->fs->add_config_dir(config_dir);
+ } else {
+ fprintf(stderr, "Invalid config dir '%s': %s\n",
+ arg + 2, strerror(errno));
+ }
return 0;
+ }
case FOLVE_OPT_DEBUG:
rt->fs->set_debug_ui_enabled(true);
folve::EnableDebugLog(true);

0 comments on commit cf1b0e0

Please sign in to comment.