Index: trunk/Nebulous-Server/bin/nebdiskd
===================================================================
--- trunk/Nebulous-Server/bin/nebdiskd	(revision 28492)
+++ trunk/Nebulous-Server/bin/nebdiskd	(revision 28525)
@@ -53,5 +53,9 @@
 # set the process name for easy pgrep-ability
 $0 = 'nebdiskd';
-my $rcfile = "$ENV{HOME}/.nebdiskrc";
+#my $rcfile = "$ENV{HOME}/.nebdiskrc";
+my $rcfile = $ENV{NEBDISKDRC};
+unless (defined($rcfile)) {
+    $rcfile = '/etc/nebdiskd.rc';
+}
 $rcfile = File::Spec->canonpath($rcfile);
 
@@ -71,6 +75,4 @@
 my %host_removed = ();
 my $failure_limit = 5;
-
-
 
 #my $mounts = $c->get_mounts;
@@ -143,4 +145,6 @@
 $SIG{HUP}  = sub { $c = read_rcfile($rcfile) }; 
 
+my $date = localtime();
+$log->warn("BEGIN: $date with RCFILE: $rcfile");
 
 while (1) {
Index: trunk/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 28492)
+++ trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 28525)
@@ -9,5 +9,5 @@
 no warnings qw( uninitialized );
 
-our $VERSION = '0.17';
+our $VERSION = '0.18';
 
 use base qw( Class::Accessor::Fast );
@@ -1508,4 +1508,106 @@
 
     return \@keys;
+}
+
+sub find_objects_wildcard
+{
+    my $self = shift;
+
+    my $log = $self->log;
+    $log->debug( "entered - @_" );
+
+    my ($pattern) = validate_pos( @_,
+        {
+            type        => SCALAR,
+            optional    => 1,
+        },
+    );
+
+    my $sql = $self->sql;
+    my $db  = $self->_db_for_index(0);
+    
+    # validate that we have a key to deal with
+    eval {
+        $pattern = parse_neb_key($pattern) if defined $pattern;
+    };
+    $log->logdie("$@") if $@;
+
+    unless (defined $pattern) {
+        $log->debug( "leaving" );
+        $log->logdie("no keys found");
+    }
+
+    # parse out the directory we're working in, and decide if we are a directory
+    my $dir_id = $self->_resolve_dir_parent_id(key => $pattern, dir_id => 1);
+    my $work_dir;
+    my $file_pattern;
+    if (defined $dir_id) {
+	$work_dir = $pattern;
+	$file_pattern = '%';
+    }
+    else {
+	my $dir_plain = dirname($pattern);
+	if ($dir_plain eq 'neb:') {
+	    $dir_plain = 'neb:///';
+	}
+	if ($dir_plain) {
+	    $work_dir = parse_neb_key($dir_plain);
+	}
+	else {
+	    $work_dir = parse_neb_key('/');
+	}
+	$log->warn("work dir: $work_dir " . $work_dir->path);
+	$file_pattern = basename $pattern;
+	unless ($file_pattern) {
+	    $file_pattern = '%';
+	}
+	
+	$dir_id = $self->_resolve_dir_parent_id(key => $work_dir, dir_id => 1);
+	unless (defined $dir_id) {
+	    $log->logdie("pattern $work_dir does not match any key or directory");
+	}
+    }
+    
+    # find dirs under dir
+    my @dir_keys;
+
+    eval {
+        $log->debug("looking for directories under dir: $dir_id");
+	$log->warn("dir_id: $dir_id pattern: $file_pattern");
+        my $query = $db->prepare_cached( $sql->find_dir_by_parent_id . " AND dirname LIKE ? ");
+        $query->execute( $dir_id, $file_pattern );
+
+        while ( my $row = $query->fetchrow_hashref ) {
+            next if $row->{'dir_id'} == 1;
+            my $dir = $row->{'dirname'};
+            if ($dir_id == 1) {
+                push @dir_keys, $dir . '/' if $dir;
+            } else {
+                push @dir_keys, $work_dir->path . '/' . $dir . '/' if $dir;
+            }
+            $log->debug( "matched $dir" ) if $dir;
+        }
+    };
+    $log->logdie("database error: $@") if $@;
+
+    # find files under dir
+    my @keys;
+    eval {
+        $log->debug("looking for objects under dir: $dir_id");
+        my $query = $db->prepare_cached( $sql->find_object_by_dir_id . " AND ext_id_basename LIKE ? ");
+        $query->execute( $dir_id , $file_pattern);
+
+        while ( my $row = $query->fetchrow_hashref ) {
+            my $key = $row->{ 'ext_id' };
+            push @keys, $key if $key;
+            $log->debug( "matched $key" ) if $key;
+        }
+    };
+    $log->logdie("database error: $@") if $@;
+
+    $log->debug( "leaving" );
+    
+    return [sort(@dir_keys), sort(@keys)];
+
 }
 
