GNOME Bugzilla – Bug 318753
more documentation in the about.sgml file
Last modified: 2005-11-08 11:19:22 UTC
Version details: gnome 2.10.2, gentoo Distribution/Version: gentoo The documentation in the about section of gnome-vfs should short describe how to use an gnome-vfs uri with the small example program and that you have to be aware to know about the relatice path and absolute path problem. A small example is introduce to make a relative url absolute. See the attached patch.
Created attachment 53409 [details] [review] more example and infos for the brief example program Because english is not my native language, please review the patch before using it. Thanks.
Created attachment 53414 [details] [review] add more examples
Thanks for your efforts! Maybe you could submit this patch to the gnome-vfs mailing list [1] for review? [1] http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
The example should use gnome_vfs_make_uri_from_shell_arg instead.
Created attachment 54212 [details] [review] changed example This patch includes some documentation and hints how to use the example in the about section and how to make your path in the filesystem absolute.
This example doesn't look right: /* using input uri as string from commandline */ char* input_uri_string = argv[1]; /* make uri absolute from relative */ if(gnome_vfs_uri_is_local(input_uri)) { /* if the uri exists we can open it.. no need for more tests */ if(gnome_vfs_uri_exists(input_uri)) { /* do somthing with the uri */ } else { /* uri is not absolute */ absolute_uri_string = gnome_vfs_make_uri_from_input_with_dirs (input_uri_string, GNOME_VFS_MAKE_URI_DIR_CURRENT); absolute_uri = gnome_vfs_uri_new(absolute_uri_string); } } It doesn't even compile (gnome_vfs_uri_is_local(input_uri) will fail because there is no input_uri variable), and it shouldn't be doing the checking on the uri at all, just call gnome_vfs_make_uri_from_input_with_dirs() on the supplied argument. And for the case of an program argument like this it should use gnome_vfs_make_uri_from_shell_arg(). Also, i think the change overempazises the uri part of the vfs. I commited a much smaller change that just allows the example to take normal unix filenames as arguments.