Re: Mount some archive and do not show it in "devices" list
- From: Jehan Pagès <jehan marmottard gmail com>
- To: Ross Lagerwall <rosslagerwall gmail com>
- Cc: gvfs-list gnome org
- Subject: Re: Mount some archive and do not show it in "devices" list
- Date: Wed, 20 Aug 2014 15:04:32 +0200
Hi,
On Wed, Aug 20, 2014 at 8:46 AM, Ross Lagerwall <rosslagerwall gmail com> wrote:
On Wed, Aug 20, 2014 at 02:06:42AM +0200, Jehan Pagès wrote:
Hello,
I have been experimenting a little with gio/gvfs. I have an archive
(tar, zip, whatever), and I mount it with
g_file_mount_enclosing_volume(). Well this works well. But then it
shows up in my file manager (Nemo in this case).
How can I request that this virtual file system is not shown in such
software? I could not find this in glib API. My use case would be some
app which just wants to open various archives and interact with files
in these transparently. If an app mounts an archive for its own usage,
you don't want to clutter the user UI (file manager, open/save
dialogs, etc.) with useless mount points, which are only for app
usage, not useful at all for user consumption.
How can I do this, is this possible?
Not that I know of...
I see.
Basically I just want to read files in archives. I could also
uncompress them, that's another possibility, but I thought that
reading files without unarchiving in some temporary directory was a
nicer design. Is not gvfs at all good for such use case? Maybe I am on
the wrong path?
Thanks!
gvfs is explicitly designed for handling users' data files; consequently
it is usually left to the user to handle mounting and unmounting of
volumes and these volumes are visible to the user. What happens if your
Ok. Well this part of the gvfs wasn't that explicit to me. At least
in-code doc or the website would not clearly say this, in my opinion.
But maybe I did not read the right doc.
program dies unexpectedly while a whole bunch of volumes are mounted?
They would hang around since mounts are per-session.
Well yes, but this is true for any data usage. What if instead, I just
used a decompressor, and unarchive in a temporary dir? Well if I crash
before deleting the dir, the data also hang around (even more annoying
because the tmp dir is not emptied at each session; it usually is at
each boot, but not necessarily). There is hardly a perfect solution on
this matter. A program crashing has a lot of potential to leave things
messy. That's why crashes are bugs. ;-)
Basically, although I like the fact that you're putting gvfs to some
interesting use case, I don't think it's the right approach.
I see. Too bad, I hoped there would exist such an API in glib/gio
already. I would personally appreciate if gvfs' design could be
extended to be able to *also* handle non-user data. Without this, I
think the gvfs integration in gio lose quite a bit of interest. I
mean, it is still very awesome, but it leave this API limited to
create explicit mounting applications (like gvfs-mount), i.e.
file-oriented apps, not applications where browsing files is only a
mean to an end, not a goal (which are quite most of them!).
Do you think this could be done? If I were to report a feature request
on bugzilla, would a mounting option for hidden mount point be
considered, or it would be refused by design?
The following may point you in the right direction for reading archives:
http://www.hadess.net/2013/12/on-beauty-of-libarchive.html
Thanks. I'll have a look, though a quick skimming of the API seems to
tell me that's not what I wanted. This allows me to list and read data
in an archive, but I actually really wanted to be able to do various
things, like execute files in an archive and such (imagine for
instance a plugin system, where plugins are composed of scripts and
data packed in some archive. Running the script from inside the
archive, and this script still being able to access the rest of its
data in its own mount point — and communicating, through pipes or
whatever, with the main program — would be quite convenient).
I had not tested this part yet, but I imagine that since a mount point
was created for the archive, it would have been possible to run a
script this way through gio, without even getting it out of its
archive. Now though, since I know that anyway any mount point would be
cluttering user UI, I'll just explore other solutions.
But if you tell me a mount option could be done for this in some
future, I'll make a feature request on bugzilla, and maybe come back
to this solution if it's implemented.
Thanks anyway for the answer.
Jehan
Regards
--
Ross Lagerwall
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]