Danke.
Sieht nicht viel anders aus als das was ich habe, nur daß ich gnome_vfs_url_show statt gnome_url_show benutze:
Code:
#include <libgnomevfs/gnome-vfs.h>
#include <stdio.h>
int print_error (GnomeVFSResult result, const char *uri_string);
int
main (int argc, char **argv)
{
if (argc < 2)
{
printf("given an URI as commandline parameter 1\n");
return 1;
}
const char *uri_string = gnome_vfs_make_uri_from_input(argv[1]);
GnomeVFSResult result;
if (!gnome_vfs_init ()) {
printf ("Could not initialize GnomeVFS\n");
return 1;
}
printf("trying gnome_vfs_url_show(%s)...\n",
gnome_vfs_format_uri_for_display(uri_string));
result = gnome_vfs_url_show(uri_string);
if (result != GNOME_VFS_OK) return print_error(result, uri_string);
printf("SUCCESS!!\n");
return 0;
}
int
print_error (GnomeVFSResult result, const char *uri_string)
{
const char *error_string = gnome_vfs_result_to_string (result);
printf ("Error '%s' occured opening location '%s'\n", error_string, uri_string
);
return 1;
}
Vielleicht liegt es auch nur an meinem Setup, könntest du es mal ausprobieren?
Ich benutzen zum kompilieren
Code:
gcc -Wall $(pkg-config --cflags --libs gnome-vfs-2.0) -o url_show url_show.c
Ciao,
_
Lesezeichen