private Rio500 getRio ()
    {
	if (rio == null) {
	    try {
		rio = new Rio500 (dev);
		rio.start ();

		folders = rio.getFolders (false);
		if (rio.hasExternalMemory ()) {
		    FolderEntry external [] = rio.getFolders (true);

		    if (external.length != 0) {
			FolderEntry temp [] =
			    new FolderEntry [folders.length + external.length];

			System.arraycopy (folders, 0, temp, 0,
			    folders.length);
			System.arraycopy (external, 0, temp, folders.length,
			    external.length);
			folders = temp;
		    }
		}
		children = new TreeNode [folders.length];

		for (int i = 0; i < folders.length; i++)
		    children [i] = new FolderNode (folders [i]);

		// we should perhaps fire an event saying
		// that our structure changed...

	    } catch (IOException e) {
		// returns null
	    } finally {
		if (rio != null)
		    rio.finish ();
	    }
	}
	return rio;
    }