catharsis / spotifile

FUSE file system for Spotify
BSD 3-Clause "New" or "Revised" License
144 stars 7 forks source link

Default mountpoint #34

Closed chelmertz closed 8 years ago

chelmertz commented 8 years ago

If I haven't mounted spotifile yet, I would like it to look into the settings' file, under something like

[spotifile]
mountpoint = /tmp/lala

and have it try to mount there if I execute ./spotifile without any arguments. As usual, exit with 0 and a friendly message on stdout if it succeed.

If I have a setting specifying the mountpoint, and have already mounted it (can we examine that "/tmp/lala" actually is a spotifile mountpoint?), I would also exit with 0 and say Already mounted on <mountpoint>.

I think it's good to allow multiple mountpoints to exist, but provide a default one. Otherwise, it's a bit smelly as in singelton-smelly ("there'll always only be one instance.." ("except when we're testing.. or when... or..."))

chelmertz commented 8 years ago

While "we" are on the subject of mountpoints.. would it make sense to have a command (either in spotifile or in a helper) that lists all mountpoints together with the username that's mounted? Use case thought out in 2 seconds:

$ spotifile-ls
/tmp/lala chelmertz timestamp-of-mounting
/tmp/boo testuser timestamp-of-mounting

That would make it very easy to discover by third party scripts without inspecting the process of spotifile or inspecting the settings file for the default mountpoint, or something else that treats internal spotifile interfaces as being explicit on purpose.

catharsis commented 8 years ago

If I haven't mounted spotifile yet, I would like it to look into the settings' file, under something like

[spotifile]
mountpoint = /tmp/lala

and have it try to mount there if I execute ./spotifile without any arguments. As usual, exit with 0 and a friendly message on stdout if it succeed.

If I have a setting specifying the mountpoint, and have already mounted it (can we examine that "/tmp/lala" actually is a spotifile mountpoint?), I would also exit with 0 and say Already mounted on .

I completely agree with this, definitely a good idea.

While "we" are on the subject of mountpoints.. would it make sense to have a command (either in spotifile or in a helper) that lists all mountpoints together with the username that's mounted?

Actually, you already have that. It's called mount and you can use it like this:

$ mount -l -t fuse.spotifile
spotifile on /home/alofgren/spotifile type fuse.spotifile (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

to do what you want :-)

catharsis commented 8 years ago

b96649ff44ec4ec8a7311de765c1edd9abaea8f4 enables setting the default mountpoint. I'm keeping this issue open until I've looked into adding a friendlier "already mounted there" type of message than:

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
Error initialising spotifile