[Mono-dev] Gnome.Vfs Initialization

Buderya Roshan broshan at novell.com
Thu Nov 17 06:48:16 EST 2005


Hi,

Before we can use Gnome.Vfs APIs to read remote files, do we need to
initialize it? If so which API is used? I didn't find a suitable API in
monodoc. Any help is appreciated.

I executed the following code -

        VfsStream sr = new
VfsStream(@"smb://server/share/file.txt",FileMode.Open);

        //Read a line from remote file
        int c;
        while ((c = sr.ReadByte()) >= 0)
        {
            Console.Write((char)c);
        }

        //Close Stream
        sr.Close();

and I get the following error -

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 291
(g_hash_table_insert): assertion `hash_table != NULL' failed

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 291
(g_hash_table_insert): assertion `hash_table != NULL' failed

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 254
(g_hash_table_lookup_extended): assertion `hash_table != NULL' failed

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 291
(g_hash_table_insert): assertion `hash_table != NULL' failed

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 225
(g_hash_table_lookup): assertion `hash_table != NULL' failed

(UncTest.exe:10655): libgnomevfs-WARNING **: Internal error: the
configuration system was not initialized. Did you call
_gnome_vfs_configuration_init?

(UncTest.exe:10655): GLib-CRITICAL **: file ghash.c: line 225
(g_hash_table_lookup): assertion `hash_table != NULL' failed

(UncTest.exe:10655): libgnomevfs-WARNING **: Internal error: the
configuration system was not initialized. Did you call
_gnome_vfs_configuration_init?

(UncTest.exe:10655): libgnomevfs-CRITICAL **: file
gnome-vfs-cancellable-ops.c: line 176
(gnome_vfs_get_file_info_uri_cancellable): assertion `uri != NULL'
failed

Unhandled Exception: System.IO.FileNotFoundException: Could not find
uri "smb://server/share/file.txt".
in <0x0098b> Gnome.Vfs.VfsStream:.ctor (System.String text_uri,
FileMode mode, Boolean async)
in <0x00012> Gnome.Vfs.VfsStream:.ctor (System.String uri, FileMode
mode)
in (wrapper remoting-invoke-with-check) Gnome.Vfs.VfsStream:.ctor
(string,System.IO.FileMode)
in <0x000ab> UncTest:DoEverything ()
in <0x00024> UncTest:Main (System.String[] args)

Is initialization the issue here?

Thanks,
Roshan



More information about the Mono-devel-list mailing list