IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 2, 2005, 7:54:17 AM (21 years ago)
Author:
eugene
Message:

more work towards addstar-2-0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/check_permissions.c

    r2457 r3361  
    6565    }
    6666  }
    67  
    6867}
    69 
    70 /* uses cp only */
    71 void make_backup (char *filename) {
    72 
    73   int status, cmode;
    74   struct stat filestat;
    75   char line [256];
    76 
    77   status = stat (filename, &filestat);
    78   if (status == 0) { /* file exists, make backup copy */
    79     sprintf (line, "cp %s %s~", filename, filename);
    80     status = system (line);
    81     if (status) {
    82       fprintf (stderr, "ERROR: unable to create %s~, exiting\n", filename);
    83       exit (1);
    84     }
    85     cmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
    86     sprintf (line, "%s~", filename);
    87     chmod (line, cmode);
    88   }
    89  
    90 }
Note: See TracChangeset for help on using the changeset viewer.