Index: trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pm	(revision 5660)
+++ trunk/Nebulous/lib/Nebulous/Client.pm	(revision 5662)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: Client.pm,v 1.20 2005-08-31 03:33:24 jhoblitt Exp $
+# $Id: Client.pm,v 1.21 2005-12-03 02:26:59 jhoblitt Exp $
 
 package Nebulous::Client;
@@ -127,4 +127,57 @@
     $log->debug( "server allocated $uri" );
 
+    my $filename;
+    eval {
+        $filename = _get_file_path( $uri );
+    };
+    $log->logdie( $@ ) if $@;
+
+    $log->debug( "local filename is $filename" );
+
+    $log->debug( "leaving" );
+
+    return $filename;
+}
+
+sub open_create {
+    my $self = shift;
+
+    my ( $key, @params ) = validate_pos( @_,
+        {
+            type        => SCALAR,
+        },
+        {
+            type        => SCALAR,
+            callbacks   => {
+                'is + integer' => sub { $_[0] =~ /^\d+$/ },
+            },
+            default     => 0,
+        },
+        {
+            type        => SCALAR,
+            optional    => 1,
+        },
+        {
+            type        => SCALAR,
+            optional    => 1,
+        },
+    );
+
+    $log->debug( "entered - @_" );
+
+    # how should already existing files be handled?
+
+    my $response = $self->{ 'server' }->create_object( $key, @params );
+    if ( $response->fault ) {
+        $log->error( $response->faultcode, " - ", $response->faultstring );
+        $log->debug( "leaving" );
+
+        return undef;
+    }
+
+    my $uri = $response->result;
+
+    $log->debug( "server allocated $uri" );
+
     my $fh;
     eval {
@@ -497,5 +550,5 @@
     );
 
-    $log->debug( "entered - @_" );
+#    $log->debug( "entered - @_" );
 
     my $fh      = $self->open( $key, 'read' );
@@ -507,5 +560,5 @@
     }
 
-    my $new_fh  = $self->create( $new_key );
+    my $new_fh  = $self->open_create( $new_key );
     unless ( $new_fh ) {
         $log->debug( "can not open object" );
