This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

1. Future Gnome VFS

(Very first attempt to structure the Gnome VFS plans ChristianKellner)

1.1. Document based API

There seem to be some consens that a future Gnome VFS should be document based and not try to copy the POSIX I/O functions. Let's try to outline the how such a API should look like to fit the needs of diffrent applications:

1.1.1. queryInterface()-style approach

(This is just a very first and very poor attempt - Please HELP! ChristianKellner)

1.2. Common VFS Layer

1.3. Discussion

ThomasFitzsimmons: Why don't we eliminate the need for the gnome-vfs APIs by finishing and adopting Gnome VFS Mount?

HavocPennington: An async/gnome-vfs/http type API can wrap POSIX file APIs, but the reverse isn't true without breaking POSIX semantics in major ways (and keeping you from implementing things you need, like progress bars). The desktop file API can really be extremely simple: get/put user-visible documents/data. For config files and caches and such, using the vfs isn't even right; you want a guaranteed local/fast filesystem or an API like gconf. The way to think about a proper gnome-vfs would be a document load/save API more than as a streams API. This is ignoring things like Storage.

PaoloMaggi: I agree with hp, we really need a document load/save API. We already have some useful code in libeel (in particular eel_read_entire_file_async) that IMO should be moved to gnome-vfs (eventually adding some way to hook data transformation, like encoding conversion, etc.). This function, with its sync pair, should solve the document load API problem. About the document save API problem, we (PaoloBorelli and I) are working on this problem for gedit and we hope to be able to propose a generic document save (with backup) API useful also for other GNOME apps. Though, ATM, it only supports sync saving (not async). Note that ATM saving remote documents in a sane way (I mean without losing permissions, ownership, etc) using gnome-vfs is not so easy due to the limitations of the various gnome-vfs modules.

PaoloBorelli: Substantially I agree with what Havoc and Paolo Maggi said above... not much to add about it. However I want to describe what would would fit our needs in gedit, so that needs of a potential consumer of the api are clearer. Ideally what we would like to see is two functions: vfs_load and vfs_save(_with_backup). To get a look at how the current gedit code to obtain something like this looks like, take a peek at gedit-document.c (loading) and at http://bugzilla.gnome.org/attachment.cgi?id=35830&action=view for a preliminary version of the saving code. Our needs are:

I guess that's enough babbling from me for now...

RaphaelBosshard: I'd like a simplified way to manage files. Default handlers for duplicate filenames, moving to trash and so on. Currently that stuff is implemented in nautilus-file-operations, but it may be interesting for other applications too, without re-implementing. Copying from nautilus is sometimes quite tricky; everything is tightly integrated there.

NicolasTrangez: Maybe this is some dumb idea, but what about a standard document format for applications using GnomeVFS? This way a document-centered approach could be easier to achieve I guess. The "document" the application receives can be compared to CDATA in XML, so GnomeVFS does not care about how the actual data is stored, but it does store this document data in some standard format. This way additional document properties can be easily added too in a standardized way. A sample of this (XML, although I'm not saying at all this should be done in XML, its just the easiest way to explain it I think):

<GnomeVfsDocument>
    <Metadata>
        <AuthorInfo>
            <Name>NicolasTrangez</Name>
        </AuthorInfo>
        <Comment>Blah</Comment>
        <Todo>Enhance this a bit</Todo>
    </Metadata>
    <DocumentData>Application gets only this when "opening" the file, can be anything: binary data, strings,...
Even exactly the same thing the application stores now</DocumentData>
</GnomeVfsDocument>

SeanMiddleditch: Just a note that I've started discussion on a true cross-desktop VFS system. The wiki for it is at http://freedesktop.org/wiki/Software/dvfs.

OlivierSessink on the simplified API: it should be capable of doing some optional extra actions as well:

Another useful addition would be to have a function to create a local copy of a VFS file such that mmap() and any other local function work, and a function that synchronizes the local copy back to VFS. I followed the discussion on the GIMP development list on the usage of gnomeVFS, and they certainly need such functionality.

OlivierSessink on the document based approach: that really fits well into the object approach that gnome is taking (every directory an object, every file an object). The document based / object approach works for any document that is a single independent unit. However, many programs work with multiple files as unity, or even directory trees as unity. For example a mathematical simulation program might have multiple files that define different parts of the simulation. Or a familiar example: a tree with .c and .h files, a Makefile, autoconf macro's etc. This discussion is beyond gnomeVFS (hmm is there a wiki on the fileselector or nautilus?), but it is important to remember that not all documents are single independent objects.

GrundigLinux on las commentary from HavocPennington: As you said, things like gnome-vfs and KIO IMO suffers has a huge design hole: it divides the filesystem namespace and doesn't lets other apps. DVFS "solves" it proposing to create "special cli commands vfs-cat, vfs-cp, vfs-move" and a dvfs -> FUSE backend. I don't think this is a good idea (requiring to modify every app on eart...) I think FUSE can solve part of the problems that gnome-vfs and KIO (and dvfs) try to solve, but it won't solve some of the problems proposed here (It's not what it has to do, either). I think we could divide the funcionality here in two big parts: One, letting people accesing SMB volumes, remote SSH filesystems (FUSE), and the other an (library) API on top of the existing standard VFS (a freedesktop standard, DVFS "redone"?) to do all the document-related work. FUSE right now is not very "user-oriented" but it is definitively cool and it already has a ssh-fs (which, I've heard, is a great nfs replacement for most of uses) and lots of filesystems and lots of users, and it's already mainstream in linux since 2.6.14 or so i think: Gnome could implement all the "user-side" and still it'd be easier than redoing gnome-vfs, and it'd work in other desktops. And there're BSD people who already has implemented FUSE-compatible functionality and windows seems to have ways of doing it too (userspace filesystems are a "must have" for modern desktop operative system these days, every os is implemeting it or it's in their TODO list). There's also a lot of work going on in the Linux VFS which will allow doing cool things (per-process filesystem namespaces) which maybe can be used to do interesting things in desktops.

JohnNilsson: Not knowing the exact problem that gnome-vfs is supposed solve, and thinking that if not following POSIX, why do files at all? So I did some resarch on interesting articles on allternatives approches, and general thinking on the subject. Posting them here in no particular order:

As mentiond above, Storage, why not start with that? How would gnome-vfs relate to Storage?

NorbertFrese: The Project Portland also has a VFS-Task. It aims to provide a generic interface to VFS-functions through scripts and a library interface.

JoachimNoreiko: This might not be the right place for this suggestion, but I think the following should be possible in GNOME: Suppose a user opens a document, say in gedit. Then,

jdv: It might be nice if the VFS did some magic to make copying, moving, transcoding (...) files appear instantaneous. Take the use case of copying a movie from disk disk 1 to disk 2: a copying dialog would still inform the user of how much data has really been transfered. To Nautilus and the thumbnailer, however, it would appear as if the movie is already fully present on disk 2. If totem was launched, it too would be able to open the file as if it was already copied in full. In the background the VFS would start by copying the file sequentially from start to finish, but allowing for rescheduling depending on what files and bytes applications like a movie thumbnailer or totem needed. Similarly, when ripping a CD it should be possible to start listening to the ripped songs right away, even if that means feeding raw (WAV) data to the music player (I believe Be used to sell a device that did this). Also, as a related idea, perhaps a VFS should allow for smart coordinating of copying and movie large files. Say if I have two disks, each with 1 GB unused; if on both disks there is a file 2 GB big. If I cut and pasted one of these files from the one disk to another, Nautilus shouldn't give me an error. Instead it should tell me it can't move the file until space is freed on the second disk. Now when you cut and paste the 2GB file from the first to the second disk, suddenly both move operations should start simultaneously, and the VFS should be smart about making these operations succeed.

<<DateTime: execution failed [Bad timestamp u'timestamp': could not convert string to float: timestamp] (see also the log)>>: Alexander Larsson posted plans for moving to a new VFS architecture here. It appears that Alexander would like to see a new VFS close to the glib level so that its API (but not necessarily its filesystem implementations) would be cross platform and its dependencies noncontroversial. In his original e-mail, Alexander also proposed to move away from URIs to a new path-based naming scheme (which perhaps would not be exposed to users). In later messages he also seemed to consider (at some level) using IRIs instead.


2024-10-23 10:58