Index: /trunk/Nebulous-Server/MANIFEST
===================================================================
--- /trunk/Nebulous-Server/MANIFEST	(revision 5045)
+++ /trunk/Nebulous-Server/MANIFEST	(revision 5046)
@@ -15,4 +15,7 @@
 docs/setup.txt
 docs/tmp.txt
+examples/Makefile
+examples/nebexample.c
+examples/nebexample.pl
 lib/Nebulous/Client.pm
 lib/Nebulous/Client.pod
Index: /trunk/Nebulous-Server/examples/Makefile
===================================================================
--- /trunk/Nebulous-Server/examples/Makefile	(revision 5046)
+++ /trunk/Nebulous-Server/examples/Makefile	(revision 5046)
@@ -0,0 +1,5 @@
+NEB_CFLAGS=`pkg-config nebclient --cflags`
+NEB_LIBS=`pkg-config nebclient --libs`
+
+nebexample: nebexample.c
+	$(CC) $(NEB_CFLAGS) $(CFLAGS) $(NEB_LIBS) $< -o $@
Index: /trunk/Nebulous-Server/examples/nebexample.c
===================================================================
--- /trunk/Nebulous-Server/examples/nebexample.c	(revision 5046)
+++ /trunk/Nebulous-Server/examples/nebexample.c	(revision 5046)
@@ -0,0 +1,45 @@
+// gcc `pkg-config nebclient --cflags --libs` example.c -o example
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <nebclient.h>
+
+#define NEB_SERVER  "http://podb1.ifa.hawaii.edu:80/nebulous"
+#define NEB_KEY     "foobarbaz"
+
+int main (int argc, char **argv) {
+    nebServer       *server = NULL;
+    char            *key = NEB_KEY;
+
+    server = nebServerAlloc(NEB_SERVER);
+    if (!server) {
+        printf("nebServerAlloc() failed\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // make sure there isn't already a file named "foobarbaz" so this example
+    // doesn't cause an error
+    nebDelete(server, key);
+
+    int fh = nebCreate(server, key, 0, NULL, NULL, NULL);
+    if (fh < 0) {
+        printf( "nebCreate() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    // fh is a file descriptor
+    close(fh);
+
+    if (!nebReplicate(server, key, NULL, NULL)) {
+        printf( "nebReplicate() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    if (!nebDelete(server, key)) {
+        printf( "nebDelete() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    exit(EXIT_SUCCESS);
+}
Index: /trunk/Nebulous-Server/examples/nebexample.pl
===================================================================
--- /trunk/Nebulous-Server/examples/nebexample.pl	(revision 5046)
+++ /trunk/Nebulous-Server/examples/nebexample.pl	(revision 5046)
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Nebulous::Client;
+
+my $neb = Nebulous::Client->new(
+    proxy   => 'http://podb1.ifa.hawaii.edu:80/nebulous'
+);
+
+my $key = shift || 'foobarbaz';
+
+# make sure there isn't already a file named "foobarbaz" so this example
+# doesn't cause an error
+$neb->delete($key);
+
+my $fh = $neb->create($key);
+die "can't create file $key " unless $fh;
+close($fh);
+
+if (!$neb->replicate($key)) {
+    die "can't replicate object $key";
+}
+
+if (!$neb->delete($key)) {
+    die "can't delete object $key";
+}
Index: /trunk/Nebulous/MANIFEST
===================================================================
--- /trunk/Nebulous/MANIFEST	(revision 5045)
+++ /trunk/Nebulous/MANIFEST	(revision 5046)
@@ -15,4 +15,7 @@
 docs/setup.txt
 docs/tmp.txt
+examples/Makefile
+examples/nebexample.c
+examples/nebexample.pl
 lib/Nebulous/Client.pm
 lib/Nebulous/Client.pod
Index: /trunk/Nebulous/examples/Makefile
===================================================================
--- /trunk/Nebulous/examples/Makefile	(revision 5046)
+++ /trunk/Nebulous/examples/Makefile	(revision 5046)
@@ -0,0 +1,5 @@
+NEB_CFLAGS=`pkg-config nebclient --cflags`
+NEB_LIBS=`pkg-config nebclient --libs`
+
+nebexample: nebexample.c
+	$(CC) $(NEB_CFLAGS) $(CFLAGS) $(NEB_LIBS) $< -o $@
Index: /trunk/Nebulous/examples/nebexample.c
===================================================================
--- /trunk/Nebulous/examples/nebexample.c	(revision 5046)
+++ /trunk/Nebulous/examples/nebexample.c	(revision 5046)
@@ -0,0 +1,45 @@
+// gcc `pkg-config nebclient --cflags --libs` example.c -o example
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <nebclient.h>
+
+#define NEB_SERVER  "http://podb1.ifa.hawaii.edu:80/nebulous"
+#define NEB_KEY     "foobarbaz"
+
+int main (int argc, char **argv) {
+    nebServer       *server = NULL;
+    char            *key = NEB_KEY;
+
+    server = nebServerAlloc(NEB_SERVER);
+    if (!server) {
+        printf("nebServerAlloc() failed\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // make sure there isn't already a file named "foobarbaz" so this example
+    // doesn't cause an error
+    nebDelete(server, key);
+
+    int fh = nebCreate(server, key, 0, NULL, NULL, NULL);
+    if (fh < 0) {
+        printf( "nebCreate() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    // fh is a file descriptor
+    close(fh);
+
+    if (!nebReplicate(server, key, NULL, NULL)) {
+        printf( "nebReplicate() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    if (!nebDelete(server, key)) {
+        printf( "nebDelete() failed: %s\n", nebErr(server));
+        exit(EXIT_FAILURE);
+    }
+
+    exit(EXIT_SUCCESS);
+}
Index: /trunk/Nebulous/examples/nebexample.pl
===================================================================
--- /trunk/Nebulous/examples/nebexample.pl	(revision 5046)
+++ /trunk/Nebulous/examples/nebexample.pl	(revision 5046)
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Nebulous::Client;
+
+my $neb = Nebulous::Client->new(
+    proxy   => 'http://podb1.ifa.hawaii.edu:80/nebulous'
+);
+
+my $key = shift || 'foobarbaz';
+
+# make sure there isn't already a file named "foobarbaz" so this example
+# doesn't cause an error
+$neb->delete($key);
+
+my $fh = $neb->create($key);
+die "can't create file $key " unless $fh;
+close($fh);
+
+if (!$neb->replicate($key)) {
+    die "can't replicate object $key";
+}
+
+if (!$neb->delete($key)) {
+    die "can't delete object $key";
+}
