3 #include <libgnomevfs/gnome-vfs.h>
7 assert_message(gboolean valid, const gchar * message)
17 main(int argc, char **argv)
19 GnomeVFSResult result;
20 GnomeVFSFileSize read;
22 GnomeVFSHandle *handle = NULL;
29 g_debug("Oppening: %s", argv[1]);
31 result = gnome_vfs_open(&handle, argv[1], GNOME_VFS_OPEN_READ);
32 assert_message(result == GNOME_VFS_OK, gnome_vfs_result_to_string(result));
34 g_debug("handle %p", handle);
36 while (result == GNOME_VFS_OK)
38 memset(buff, '\0', sizeof(buff));
39 result = gnome_vfs_read(handle, buff, sizeof(buff), &read);
40 g_debug("read %" G_GINT64_FORMAT, read);
43 assert_message(result == GNOME_VFS_ERROR_EOF,
44 gnome_vfs_result_to_string(result));
46 result = gnome_vfs_close(handle);
47 assert_message(result == GNOME_VFS_OK, gnome_vfs_result_to_string(result));