Re: gvfs-client



Hey Jeff,


I'd like to write a client without UI to upload/download files
automatically on the webdav servers.
See http://git.gnome.org/cgit/gvfs/tree/programs/gvfs-save.c, http://git.gnome.org/cgit/gvfs/tree/programs/gvfs-cat.c and http://git.gnome.org/cgit/gvfs/tree/programs/gvfs-copy.c for simple programs that kinda seems to do what you want, if I understood you correctly.


So I'd like to know how to communicate with gvfsd daemon.
As said before the client interface is gio (part of glib). The use of gvfs for remote location is totally transparent. Documentation is here http://library.gnome.org/devel/gio/stable/ (See http://library.gnome.org/devel/gio/stable/ch01.html for an architecture overview and how gvfs and gio work together)


Nautilus looks too complicated, so I hope there's a more simple one.
gvfs-save, gvfs-cat and gvfs-copy are pretty simple; save and cat work with data streams you get/put and copy only with files. One thing notably that is missing in all examples is the mounting of the remote destination. If you are only dealing with HTTP is no problem since that will be auto-mounted on demand. In case of webdav, it isn't. So if you don't have an existing mount of the remote webdav share and you try to transfer data from/to it you will receive and GIO error telling you that the location isn't mounted yet. Look at programs/gvfs-mount.c for a way how to do the mount then.

One thing though: I am not 100% sure what you plan exactly is, but if all you want is http/webdav you might wanna consider using libsoup directly instead of gio/gvfs ; it is the http library the http/webdav backend is using. Http (and sadly enough also webdav) and file system abstractions often don't go so well together and we make a lot of background assumptions and also there are some problems here and there. On the other hand if you are doing simple stuff it might just be good enough.

Cheers,
Christian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]