Index: /trunk/Ohana/src/libohana/include/ohana.h
===================================================================
--- /trunk/Ohana/src/libohana/include/ohana.h	(revision 8384)
+++ /trunk/Ohana/src/libohana/include/ohana.h	(revision 8385)
@@ -125,4 +125,5 @@
 void    make_backup            PROTO((char *filename));
 int     check_file_access      PROTO((char *basefile, int backup, int verbose));
+int     check_dir_access       PROTO((char *path, int verbose));
 int     check_file_exec        PROTO((char *filename));
 
Index: /trunk/Ohana/src/libohana/src/CommOps.c
===================================================================
--- /trunk/Ohana/src/libohana/src/CommOps.c	(revision 8384)
+++ /trunk/Ohana/src/libohana/src/CommOps.c	(revision 8385)
@@ -74,5 +74,5 @@
 int SendMessage (int device, char *format, ...) {
 
-  int Nbyte, status;
+  int Nbyte;
   char tmp;
   va_list argp;  
Index: /trunk/Ohana/src/libohana/src/IOBufferOps.c
===================================================================
--- /trunk/Ohana/src/libohana/src/IOBufferOps.c	(revision 8384)
+++ /trunk/Ohana/src/libohana/src/IOBufferOps.c	(revision 8385)
@@ -102,6 +102,6 @@
   /* add the output line to the given IOBuffer */
   
-  int Nbyte, status;
-  char tmp, *line;
+  int Nbyte;
+  char tmp;
 
   Nbyte = vsnprintf (&tmp, 0, format, argp);
Index: /trunk/Ohana/src/libohana/src/findexec.c
===================================================================
--- /trunk/Ohana/src/libohana/src/findexec.c	(revision 8384)
+++ /trunk/Ohana/src/libohana/src/findexec.c	(revision 8385)
@@ -25,13 +25,10 @@
 }
 
-/* check that file can be written to:
+/* check that:
    - dir exists
    - dir permissions OK
-   - file permissions OK, 
-   - file backup permission OK (optional)
-*/
-int check_file_access (char *basefile, int BACKUP, int VERBOSE) {
-  
-  char *path, *filename;
+*/
+int check_dir_access (char *path, int VERBOSE) {
+  
   struct stat filestat;
   uid_t uid;
@@ -43,5 +40,4 @@
 
   /* check permission to write to directory */
-  path = pathname (basefile);
   status = stat (path, &filestat);
   if (status == -1) {
@@ -62,5 +58,29 @@
     return (FALSE);
   }
+  return (TRUE);
+}
+
+/* check that file can be written to:
+   - dir exists
+   - dir permissions OK
+   - file permissions OK, 
+   - file backup permission OK (optional)
+*/
+int check_file_access (char *basefile, int BACKUP, int VERBOSE) {
+  
+  char *path, *filename;
+  struct stat filestat;
+  uid_t uid;
+  gid_t gid;
+  int status;
+
+  uid = getuid();
+  gid = getgid();
+
+  /* check permission to write to directory */
+  path = pathname (basefile);
+  status = check_dir_access (path, VERBOSE);
   free (path);
+  if (!status) return (FALSE);
   
   /* check permission to write to file */
Index: /trunk/Ohana/src/libohana/src/time.c
===================================================================
--- /trunk/Ohana/src/libohana/src/time.c	(revision 8384)
+++ /trunk/Ohana/src/libohana/src/time.c	(revision 8385)
@@ -410,5 +410,5 @@
 double ohana_lst (double jd, double longitude) {
 
-  double t, ut, jdmid, jdint, jdfrac, sid_g, sid;
+  double t, ut, jdmid, jdint, jdfrac, sid_g;
   long sid_int;
 
