Task Description
Both Gnome and KDE have a notion of both standards (http:, https:, ftp:) and desktop specific resources (e.g. floppy:, media:) that these environments refer to with URLs. Currently, applications not specifically written for either of these environments have no way to access the desktop specific resources.
Analysis
Existing solutions
Proposed Solution
See xdg-copy in the xdg-utils directory of the Portland CVS module.
See the LocalFile, UploadFile and RemoveTemporaryLocalFile methods in DAPI, part of the Portland CVS module.
xdg-vfs also follows the xdg-utils concept. It is a script which delegates to the desktop specific binaries xdg-vfs-gnome and xdg-vfs-kde. It provides a generic interface to VFS functions get, put, cp, mv, rm, mkdir, rmdir, info, setattrs, ls, openfildlg, savefildlg. It is not part of xdg-utils yet, but might become part of them in the future.
libxdg-vfs is a client library for the xdg-vfs executables. It runs xdg-vfs in shell-mode to execute commands in a 'session'. The backend process will be alive as long as the client doesn't close this session.
Download the sources of libxdg-vfs, the backends and a VFS-browser demo from Portland CVS module.
xdg-vfs in not actively developed at the moment, because a shared VFS or a FUSE approach might be preferred to solve this issue
Known Problems
Comments
(NorbertFrese) VFS aware filedialogs: I think the proposed solutions ('xdg-file-dialog' or 'xdg-vfs openfiledialog') just won't work because many applications need to customize filedialogs. In my opinion a VFS interface like xdg-vfs should be used by filedialogs rather than providing them. In this case we need a rich set of functions in the VFS-interface (ls, mkdir but maybe also paths to mime icons...).
Gtk-file-chooser, for instance, already has pluggable backends (GtkFileSystem), and - maybe - could also use a generic VFS interface.
(NorbertFrese) A C-library interface would definitely be better than scripts, but there is the problem of incompatible event-loops. While a shared event-loop ( QDevBlog, Common Main Loop ) won't happen soon, one possible solution is shown in Avahi. Avahi uses Eventloop Abstraction to integrate with different toolkits. See the file watch.h and read this message.
(NorbertFrese) For future desktops (KDE4) the problem of incompatible event loops seems to be solved. Qt >= 4.2 http://doc.trolltech.com/4.2/qt4-2-intro.html will have a configure option to use Glib main event loop. If Glib main event loop becomes standard for all toolkits and applications, this will open up the opportunity to write asynchronous desktop-adapter libraries (like DAPI and libxdg-vfs) in Glib style C, or even solve some of the portland issues by moving libraries (Network transparency is a good candidate) to a "common infrastructure layer".
Here is a message about the "adapter approach" versus the "infrastructure approach": http://lists.freedesktop.org/archives/portland/2006-January/000088.html.
(Where it's possible i would always prefer the "infrastructure approach", because it allowes a clear package dependency chain. An application which uses network-transparency will simply have a dependency to the common VFS library. With the adapter approach there is a problem with the package dependency chain. For instance Open-Office uses an adapter approach for Gnome/Gnome-VFS and KDE/KIO. Of course the adapter packages are not - can not be - in the dependencies of Open-Office. It just happened to me. You have to be an expert to know that such adapter packages exist.)
(BernhardFastenrath) Plan 9 file servers using v9fs would offer a network format and allow the Linux kernel to access these filesystems.
(WaldoBastian) Another approach to provide applications access to virtual file systems is to turn them into "real" filesystems with a filesystem in user space (FUSE) See also http://lists.freedesktop.org/archives/portland/2006-July/000660.html and http://rlove.org/log/2006070601
(NorbertFrese) libfusi provides a desktop interface for managing FUSE mounts. It's a FUSE-only approach, using existing fuse-modules like sshfs, curlftpfs, fusesmb and wdfs. GVFS, the successor of Gnome-VFS, follows a hybrid approach of a URI based network transparency library with a FUSE bridge for legacy applications which don't link GVFS directly.


