Bonobo::Storage::list_contents question



Hi,

Why doesn't the following program work for storages stored inside
storages? It can't get the contents of storages that are inside the root
storage.

void list_storage (char *prefix, Bonobo_Storage storage)
{
    CORBA_Environment ev;
    CORBA_exception_init (&ev);
    
    Bonobo_Storage_directory_list *dirlist =
	Bonobo_Storage_list_contents (storage, "", &ev);
    
    if (dirlist != CORBA_OBJECT_NIL)
    {
	for (unsigned int i = 0; i < dirlist->_length; i++)
	{
	    CORBA_char *cstring = dirlist->_buffer [i];
	    char* curr_filename = (char*) cstring;

	    printf ("%s/%s\n", prefix, curr_filename);
	    
	    Bonobo_Storage subdir = Bonobo_Storage_open_storage
		(storage, curr_filename, Bonobo_Storage_READ, &ev);
	    
	    if (subdir != CORBA_OBJECT_NIL)
	    {
		char *new_prefix = g_strdup_printf ("%s/%s", prefix,
						    curr_filename);
		list_storage (new_prefix, subdir);
		g_free (new_prefix);
	    }
	}

    }

    CORBA_free (dirlist);
    CORBA_exception_free (&ev);
}

-- 
   .--= ULLA! =----------------------------.  finger cactus@cactus.rulez.org
   \      http://cactus.rulez.org           \   for PGP public key
    `----------= cactus@cactus.rulez.org =--'
Rosszak a reflexeim. Egyszer elutott egy auto, amit 2 ember tolt.






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