Index: branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm	(revision 24557)
@@ -9,5 +9,5 @@
 no warnings qw( uninitialized );
 
-our $VERSION = '0.09';
+our $VERSION = '0.17';
 
 use Digest::MD5;
@@ -16,5 +16,5 @@
 use Nebulous::Client::Log;
 use Nebulous::Util qw( :standard );
-use Params::Validate qw( validate validate_pos SCALAR UNDEF );
+use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN );
 #use SOAP::Lite +trace => [qw( debug )];
 use SOAP::Lite;
@@ -329,4 +329,11 @@
     my $uri = $self->delete_instance($key, @$locations[0]);
 
+    eval {
+        _nuke_file(_get_file_path(@$locations[0]));
+    };
+    if ($@) {
+        $log->logdie($@);
+    }
+
     $log->debug("leaving");
 
@@ -803,7 +810,17 @@
     my $self = shift;
 
-    my ( $key ) = validate_pos( @_,
-        {
-            type => SCALAR,
+    my ($key, $force) = validate_pos( @_,
+        {
+            type        => SCALAR,
+        },
+        {
+            type        => BOOLEAN,
+            optional    => 1,
+            default     => undef,
+            callbacks   => {
+                'is boolean' => sub {
+                    $_[0] == 0 or $_[0] == 1 or $_[0] == undef;
+                },
+            },
         },
     );
@@ -817,5 +834,32 @@
     # a lock is implicitly removed when the last storage object is deleted
     foreach my $uri ( @$locations ) {
+        # it is being assumed here that it is better to have files on disk and
+        # not in the database then the inverse.
+        my $path;
+        eval {
+            $path = _get_file_path( $uri );
+        };
+        if ($@) {
+            if ($force) {
+                $log->warn($@);
+                $log->warn("exception ignored because force is in effect");
+            } else {
+                $log->logdie($@);
+            }
+        }
+
         $self->delete_instance($key, $uri) or return undef;
+
+        eval {
+            _nuke_file( $path );
+        };
+        if ($@) {
+            if ($force) {
+                $log->warn($@);
+                $log->warn("exception ignored because force is in effect");
+            } else {
+                $log->logdie($@);
+            }
+        }
     }
 
@@ -959,13 +1003,4 @@
     $log->debug( "entered - @_" );
 
-    # it is being assumed here that it is better to have files on disk and not in
-    # the database then the inverse.
-
-    my $path;
-    eval {
-        $path = _get_file_path( $uri );
-    };
-    $log->logdie( $@ ) if $@;
-
     my $response = $self->{ 'server' }->delete_instance($key, $uri);
     if ( $response->fault ) {
@@ -982,9 +1017,4 @@
     $log->debug( "server deleted instance" );
 
-    eval {
-        _nuke_file( $path );
-    };
-    $log->logdie( $@ ) if $@;
-
     $log->debug( "leaving" );
 
@@ -1045,4 +1075,43 @@
 
     return $stats;
+}
+
+
+sub chmod
+{
+    my $self = shift;
+
+    my ($key, $mode) = validate_pos( @_,
+        {
+            type => SCALAR,
+        },
+        {
+            type => SCALAR,
+            regex       => qr/\d{3,4}/,
+        },
+    );
+
+    $log->debug( "entered - @_" );
+
+    my $response = $self->{ 'server' }->chmod_object($key, $mode);
+    if ( $response->fault ) {
+        $self->set_err($response->faultstring);
+        if ($response->faultstring =~ /is valid object key/) {
+            $log->debug( "leaving" );
+            return;
+        }
+        if ($response->faultstring =~ /is allowable mode/) {
+            $log->debug( "leaving" );
+            return;
+        }
+
+        $log->logdie("unhandled fault - ", $self->err);
+    }
+
+    my $response_mode = $response->result;
+
+    $log->debug( "leaving" );
+
+    return $response_mode;
 }
 
Index: branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod
===================================================================
--- branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod	(revision 24557)
@@ -13,10 +13,10 @@
     );
 
-    my $uri = $neb->create( "key", "node01" );
-    my $fh = $neb->open_create( "key", "node01" );
-    $neb->replicate( "key", "node01" );
-    $neb->cull( "key", "node01" );
-    $neb->lock( "key", 'write' );
-    $neb->unlock( "key", 'write' );
+    my $uri = $neb->create( $key, $vol );
+    my $fh = $neb->open_create( $key, $vol );
+    $neb->replicate( $key, $vol );
+    $neb->cull( $key, $vol );
+    $neb->lock( $key, 'write' );
+    $neb->unlock( $key, 'write' );
     $neb->setxattr( $key, $name, $value, $flags );
     $neb->getxattr( $key, $name );
@@ -24,14 +24,15 @@
     $neb->removexattr( $key, $name );
     my $uris = $neb->find_objects( $pattern );
-    my $uris = $neb->find_instances( "key", "node01" );
-    my $path = $neb->find( "key" );
-    my $fh = $neb->open( "key", 'read' );
-    $neb->delete( "key" );
-    $neb->copy( "key", "new_key", "node01" );
-    $neb->move( "key", "new_key" );
-    $neb->swap( "key1", "key2" );
+    my $uris = $neb->find_instances( $key, $vol );
+    my $path = $neb->find( $key );
+    my $fh = $neb->open( $key, 'read' );
+    $neb->delete( $key );
+    $neb->copy( $key, $new_key, $vol );
+    $neb->move( $key, $new_key );
+    $neb->swap( $key1, $key2 );
     $neb->delete_instance( $uri );
-    my $stats = $neb->stat( "key" );
+    my $stats = $neb->stat( $key );
     my $mounts = $neb->mounts();
+    my $mode = $neb->chmod( $key, $mode );
 
 =head1 DESCRIPTION
@@ -425,4 +426,11 @@
     ]
 
+=item * chmod( $key, $mode );
+
+Accepts 2 parameters, both mandatory.  C<$key> is the nebulous key to operate
+on and C<$mode> are the POSIX like file permissions to set on all instances of
+C<$key>.  C<$mode> must be specified in oct.  Returns C<$mode> or sucess or an
+exception on failure.
+
 =back
 
