From aa3f1fcdab5929e541f993b9a42799b7a862ef2b Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Wed, 2 Nov 2022 20:00:02 -0500 Subject: [PATCH] automatic backup --- .ccls-cache/@home@huck@.repos@odot/file.c | 28 ++++++++++++++---- .../@home@huck@.repos@odot/file.c.blob | Bin 5971 -> 6742 bytes .ccls-cache/@home@huck@.repos@odot/func.c | 2 +- .../@home@huck@.repos@odot/func.c.blob | Bin 4722 -> 4774 bytes .../@home@huck@.repos@odot/structure.c | 4 --- .../@home@huck@.repos@odot/structure.c.blob | Bin 3722 -> 3373 bytes file.c | 28 ++++++++++++++---- func.c | 2 +- structure.c | 4 --- 9 files changed, 48 insertions(+), 20 deletions(-) diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c b/.ccls-cache/@home@huck@.repos@odot/file.c index d4fcd1d..f636508 100644 --- a/.ccls-cache/@home@huck@.repos@odot/file.c +++ b/.ccls-cache/@home@huck@.repos@odot/file.c @@ -8,13 +8,14 @@ enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; void add(struct task t, int size){ - int l,m,h,i; - - h = linecount(); + int l,m,h,i,len; + FILE *fcopy; + char *s; + h = len = linecount(); m = h / 2; l = 0; - while (h != m && m != l){ + while (!(h == m && m == l)){ i = strcmp(t.task,gettask().task); if (i < 0) { @@ -27,9 +28,26 @@ void add(struct task t, int size){ } m = (h + l)/2; + fseek(fp, m, SEEK_SET); + } + + fseek(fp, 0, SEEK_SET); + fcopy = fopen("/tmp/fcopy", "w"); + + for (i = 0; i < len;){ + if (i == m){ + fprintf(fp, "%s\t%i\t%s\n",t.task,t.date,t.group); + } else { + fgets(s, MAXLINE, fp); + fputs(s, fcopy); + i++; + } } + fclose(fp); + fclose(fcopy); + remove(TODOLIST); + rename("/tmp/fcopy", TODOLIST); - puttask(t); return; } diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c.blob b/.ccls-cache/@home@huck@.repos@odot/file.c.blob index 1421e3e8dd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