Fixed old file move

This commit is contained in:
Michiel Broek 2001-12-13 19:34:18 +00:00
parent 558c79c6bf
commit 729035e7e9
2 changed files with 10 additions and 13 deletions

View File

@ -164,8 +164,8 @@ void Kill(void)
if (area.MoveArea) { if (area.MoveArea) {
fseek(pAreas, ((area.MoveArea -1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET); fseek(pAreas, ((area.MoveArea -1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET);
fread(&darea, areahdr.recsize, 1, pAreas); fread(&darea, areahdr.recsize, 1, pAreas);
sprintf(from, "%s/%s", area.Path, file.Name); sprintf(from, "%s/%s", area.Path, file.LName);
sprintf(to, "%s/%s", darea.Path, file.Name); sprintf(to, "%s/%s", darea.Path, file.LName);
if ((rc = file_mv(from, to)) == 0) { if ((rc = file_mv(from, to)) == 0) {
Syslog('+', "Move %s, area %d => %d", file.Name, i, area.MoveArea); Syslog('+', "Move %s, area %d => %d", file.Name, i, area.MoveArea);
sprintf(to, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), area.MoveArea); sprintf(to, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), area.MoveArea);
@ -178,8 +178,8 @@ void Kill(void)
/* /*
* Now again if there is a dotted version (thumbnail) of this file. * Now again if there is a dotted version (thumbnail) of this file.
*/ */
sprintf(from, "%s/.%s", area.Path, file.Name); sprintf(from, "%s/.%s", area.Path, file.LName);
sprintf(to, "%s/.%s", darea.Path, file.Name); sprintf(to, "%s/.%s", darea.Path, file.LName);
if (file_exist(from, R_OK) == 0) if (file_exist(from, R_OK) == 0)
file_mv(from, to); file_mv(from, to);
file.Deleted = TRUE; file.Deleted = TRUE;
@ -187,15 +187,16 @@ void Kill(void)
fwrite(&file, sizeof(file), 1, pFile); fwrite(&file, sizeof(file), 1, pFile);
iMoved++; iMoved++;
} else { } else {
WriteError("Move %s failed rc = %d", file.Name, rc); WriteError("Move %s to area %d failed rc = %d",
file.Name, area.MoveArea, rc);
} }
} else { } else {
Syslog('+', "Delete %s, area %d", file.Name, i); Syslog('+', "Delete %s, area %d", file.LName, i);
file.Deleted = TRUE; file.Deleted = TRUE;
fseek(pFile, - sizeof(file), SEEK_CUR); fseek(pFile, - sizeof(file), SEEK_CUR);
fwrite(&file, sizeof(file), 1, pFile); fwrite(&file, sizeof(file), 1, pFile);
iKilled++; iKilled++;
sprintf(from, "%s/%s", area.Path, file.Name); sprintf(from, "%s/%s", area.Path, file.LName);
unlink(from); unlink(from);
} }
} }
@ -211,7 +212,7 @@ void Kill(void)
if ((pTemp = fopen(sTemp, "a+")) != NULL) { if ((pTemp = fopen(sTemp, "a+")) != NULL) {
FilesLeft = FALSE; FilesLeft = FALSE;
while (fread(&file, sizeof(file), 1, pFile) == 1) { while (fread(&file, sizeof(file), 1, pFile) == 1) {
if ((!file.Deleted) && strcmp(file.Name, "") != 0) { if ((!file.Deleted) && strcmp(file.LName, "") != 0) {
fwrite(&file, sizeof(file), 1, pTemp); fwrite(&file, sizeof(file), 1, pTemp);
FilesLeft = TRUE; FilesLeft = TRUE;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbfido/postecho.c * $Id$
* Purpose ...............: Post echomail message. * Purpose ...............: Post echomail message.
* Last modification date : 01-Sep-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -57,7 +56,6 @@ extern int do_quiet; /* No tty output */
extern int do_unsec; /* Toss unsecure */ extern int do_unsec; /* Toss unsecure */
extern int check_dupe; /* Check dupes */ extern int check_dupe; /* Check dupes */
extern time_t t_start; /* Reference time */ extern time_t t_start; /* Reference time */
extern int most_debug; /* Heavy debugging */
extern int echo_in; /* Echomail processed */ extern int echo_in; /* Echomail processed */
extern int echo_out; /* Echomail forwarded */ extern int echo_out; /* Echomail forwarded */
extern int echo_bad; /* Bad echomail */ extern int echo_bad; /* Bad echomail */
@ -557,9 +555,7 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj,
fprintf(qp, "%s\n", buf); fprintf(qp, "%s\n", buf);
} }
rewind(qp); rewind(qp);
most_debug = TRUE;
ftn2rfc(f, t, subj, orig, mdate, flags, qp); ftn2rfc(f, t, subj, orig, mdate, flags, qp);
most_debug = FALSE;
fclose(qp); fclose(qp);
} }
fclose(nfp); fclose(nfp);