Changeset 3361 for trunk/Ohana/src/addstar/src/check_permissions.c
- Timestamp:
- Mar 2, 2005, 7:54:17 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/check_permissions.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/check_permissions.c
r2457 r3361 65 65 } 66 66 } 67 68 67 } 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.
