[BACK]Return to fileio.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/fileio.c between version 1.3 and 1.4

version 1.3, 2000/02/25 19:13:21 version 1.4, 2000/02/26 23:22:44
Line 1 
Line 1 
 /*  /*
  *              sys V fileio.c   *              POSIX fileio.c
  */   */
 #include        "def.h"  #include        "def.h"
   
Line 304 
Line 304 
   
 #ifndef NO_STARTUP  #ifndef NO_STARTUP
 #include <sys/file.h>  #include <sys/file.h>
 #ifndef F_OK  
 #define F_OK 04                 /* for stupid Sys V             */  
 #endif  
   
 /*  /*
  * Find a startup file for the user and return its name. As a service   * Find a startup file for the user and return its name. As a service
Line 348 
Line 345 
 #endif  #endif
   
 #ifndef NO_DIRED  #ifndef NO_DIRED
   #include <sys/wait.h>
 #include "kbd.h"  #include "kbd.h"
   
 /*  /*
Line 437 
Line 435 
     bcopy(&lp->l_text[56], cp, llength(lp) - 56);      bcopy(&lp->l_text[56], cp, llength(lp) - 56);
     cp[llength(lp) - 56] = '\0';      cp[llength(lp) - 56] = '\0';
     return lgetc(lp, 2) == 'd';      return lgetc(lp, 2) == 'd';
 }  
   
 /*  
  * I, a System V novice, could only figure out how to do unlinkdir()  
  * and rename() as exec's of the appropriate functions.  So sue me.  
  * --Stephen Walton, December 1987  
  */  
   
 unlinkdir(f)  
 char *f;  
 {  
         int status, pid, wpid;  
   
         if ((pid = fork()) == 0)  
                 execl("/bin/rmdir", "rmdir", f, (char *)NULL);  
         else if (pid > 0)  
                 while ((wpid = wait(&status)) && wpid != pid)  
                         ;  
         else  
                 return FALSE;  
         return status == 0;  
 }  
   
 Xrename(f1, f2)  
 char *f1, *f2;  
 {  
   
         int status, pid, wpid;  
   
         if ((pid = fork()) == 0)  
                 execl("/bin/mv", "mv", f1, f2, (char *)NULL);  
         else if (pid > 0)  
                 while ((wpid = wait(&status)) && wpid != pid)  
                         ;  
         else  
                 return FALSE;  
         return status == 0;  
 }  }
 #endif NO_DIRED  #endif NO_DIRED
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4