about summary refs log tree commit diff stats
path: root/src/LYTraversal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYTraversal.c')
-rw-r--r--src/LYTraversal.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/LYTraversal.c b/src/LYTraversal.c
index 500475d3..44853908 100644
--- a/src/LYTraversal.c
+++ b/src/LYTraversal.c
@@ -16,7 +16,7 @@ PUBLIC BOOLEAN lookup ARGS1(char *,target)
     char buffer[200], line[200];
 
     if ((ifp = fopen(TRAVERSE_FILE,"r")) == NULL) {
-        if ((ifp = fopen(TRAVERSE_FILE,"w")) == NULL) {
+        if ((ifp = LYNewTxtFile(TRAVERSE_FILE)) == NULL) {
             perror("unable to open or create a traversal file");
 #ifndef NOSIGHUP
 	    (void) signal(SIGHUP, SIG_DFL);
@@ -32,9 +32,6 @@ PUBLIC BOOLEAN lookup ARGS1(char *,target)
             exit(-1);
 	} else {
             fclose(ifp);
-#ifndef __DJGPP__
-	    chmod(TRAVERSE_FILE, 0600);
-#endif /* __DJGPP__ */
             return(FALSE);
         }
     }
@@ -57,7 +54,7 @@ PUBLIC void add_to_table ARGS1(char *,target)
 
     FILE *ifp;
 
-    if ((ifp = fopen(TRAVERSE_FILE,"a+")) == NULL) {
+    if ((ifp = LYAppendToTxtFile(TRAVERSE_FILE)) == NULL) {
 	perror("unable to open traversal file");
 #ifndef NOSIGHUP
 	(void) signal(SIGHUP, SIG_DFL);
@@ -72,9 +69,6 @@ PUBLIC void add_to_table ARGS1(char *,target)
 #endif /* SIGTSTP */
 	exit(-1);
     }
-#ifndef __DJGPP__
-    chmod(TRAVERSE_FILE, 0600);
-#endif /* __DJGPP__ */ 
 
     fprintf(ifp,"%s\n",target);
 
@@ -86,7 +80,7 @@ PUBLIC void add_to_traverse_list ARGS2(char *,fname, char *,prev_link_name)
 
     FILE *ifp;
 
-    if ((ifp = fopen(TRAVERSE_FOUND_FILE,"a+")) == NULL) {
+    if ((ifp = LYAppendToTxtFile(TRAVERSE_FOUND_FILE)) == NULL) {
 	perror("unable to open traversal found file");
 #ifndef NOSIGHUP
 	(void) signal(SIGHUP, SIG_DFL);
@@ -101,9 +95,6 @@ PUBLIC void add_to_traverse_list ARGS2(char *,fname, char *,prev_link_name)
 #endif /* SIGTSTP */
 	exit(-1);
     }
-#ifndef __DJGPP__ 
-    chmod(TRAVERSE_FOUND_FILE, 0600);
-#endif /* __DJGPP__ */ 
 
     fprintf(ifp,"%s\t%s\n",fname, prev_link_name);
 
@@ -118,13 +109,10 @@ PUBLIC void dump_traversal_history NOARGS
     if (nhist <= 0)
         return;
 
-    if ((ifp = fopen(TRAVERSE_FILE,"a+")) == NULL) {
+    if ((ifp = LYAppendToTxtFile(TRAVERSE_FILE)) == NULL) {
         perror("unable to open traversal file");
 	return;
     }
-#ifndef __DJGPP__ 
-    chmod(TRAVERSE_FILE, 0600);
-#endif /* __DJGPP__ */  
 
     fprintf(ifp, "\n\nTRAVERSAL WAS INTERUPTED\n\n\
 \t    here is a list of the history stack so that you may rebuild\n\n");
@@ -141,7 +129,7 @@ PUBLIC void add_to_reject_list ARGS1(char *,target)
 
     FILE *ifp;
 
-    if ((ifp = fopen(TRAVERSE_REJECT_FILE,"a+")) == NULL) {
+    if ((ifp = LYAppendToTxtFile(TRAVERSE_REJECT_FILE)) == NULL) {
 	perror("unable to open reject file");
 #ifndef NOSIGHUP
 	(void) signal(SIGHUP, SIG_DFL);
@@ -156,9 +144,6 @@ PUBLIC void add_to_reject_list ARGS1(char *,target)
 #endif /* SIGTSTP */
 	exit(-1);
     }
-#ifndef __DJGPP__   
-    chmod(TRAVERSE_REJECT_FILE, 0600);
-#endif /* __DJGPP__ */  
 
     fprintf(ifp,"%s\n",target);