Index: trunk/Ohana/src/tools/Makefile
===================================================================
--- trunk/Ohana/src/tools/Makefile	(revision 39325)
+++ trunk/Ohana/src/tools/Makefile	(revision 39326)
@@ -17,5 +17,11 @@
 PROGRAMS = gconfig fhead pspsconvert ftable fields list_astro glockfile \
 radec mktemp precess csystem fits_insert \
-medianfilter mefhead ckfits roc random fits_to_mysql
+medianfilter mefhead ckfits random fits_to_mysql
+
+# roc
+# CZW: 2016-01-29 Removing roc from the list of programs, as I've made
+# changes to it that require the nebclient library.  This complicates
+# the dependency chain, and as roc isn't generally used, pulling it
+# out is easier than solving that chain.
 
 all tools: $(PROGRAMS)
@@ -28,4 +34,7 @@
 FULL_CPPFLAGS = $(BASE_CPPFLAGS)
 FULL_LDFLAGS  = -ldvo -lFITS -lohana $(BASE_LDFLAGS)
+
+# CZW: required library for roc to compile.
+# -lnebclient
 
 # these are all programs which just depend on a single c file: foo : foo.c
Index: trunk/Ohana/src/tools/src/roc.c
===================================================================
--- trunk/Ohana/src/tools/src/roc.c	(revision 39325)
+++ trunk/Ohana/src/tools/src/roc.c	(revision 39326)
@@ -3,4 +3,5 @@
 # include <sys/types.h>
 # include <regex.h>
+# include <nebclient.h>
 
 # define ROC_HEADER_SIZE  0x1000
@@ -16,4 +17,6 @@
 int usage (void);
 int print_block (char *header, int *header_size, int *Noff, char *format,...);
+
+FILE *fopen_harder(char *filename);
 
 int main (int argc, char **argv) {
@@ -241,5 +244,5 @@
   for (i = 0; i < Ninput; i++) {
     if (i == Nfile) continue;
-    input[i] = fopen(inputName[i], "r");
+    input[i] = fopen_harder(inputName[i]);
     myAssert (input[i], "failed to open file");
   }
@@ -364,8 +367,15 @@
 
   ALLOCATE (input, FILE *, Ninput);
-  for (i = 0; i < Ninput; i++) {
-    input[i] = fopen(inputName[i], "r");
-    myAssert (input[i], "failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName);
-  }
+  int error = 0;
+  for (i = 0; i < Ninput; i++) {
+    //    input[i] = fopen(inputName[i], "r");
+    input[i] = fopen_harder(inputName[i]);
+    //    myAssert (input[i], "failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName);
+    if (!(input[i])) {
+      fprintf(stderr,"failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName);
+      error += 1;
+    }
+  }
+  myAssert((error == 0), "Assertation that all were fine failed.");
 
   ALLOCATE (inputData, char *, Ninput);
@@ -409,4 +419,46 @@
 }
 
+FILE *fopen_harder (char *filename) {
+  FILE *try;
+
+  fprintf(stderr,"TRYING: %s\n",filename);
+  try = fopen(filename,"r");
+  if (try) { return(try); }
+
+  char *root = filerootname(filename);
+  fprintf(stderr,"TRYING: %s\n",root);
+  try = fopen(root,"r");
+  if (try) { return(try); }
+
+  
+  char *key = malloc(sizeof(char) * (strlen(root) + 6));
+  char *token = strtok(root,".");
+  sprintf(key,"neb://");
+  token = strtok(NULL,":");
+  while (token) {
+    sprintf(key,"%s/%s",key,token);
+    token = strtok(NULL,":");
+  }
+  sprintf(key,"%s.fits",key);
+  fprintf(stderr,"WILL_TRY: %s\n",key);
+  
+  char *disk_file = NULL;
+  nebServer *server = nebServerAlloc("http://ippc08/nebulous");
+  disk_file = nebFind(server,key);
+  //  nebServerFree(server);
+  //  free(key);
+  
+  if (disk_file) {
+    fprintf(stderr,"TRYING: %s\n",disk_file);
+    try = fopen(disk_file,"r");
+    if (try) { return(try); }
+  }
+
+  return(NULL);
+}
+
+   
+  
+
 int roc_insert (int argc, char **argv) {
 
