Fixed old file move
This commit is contained in:
parent
558c79c6bf
commit
729035e7e9
@ -164,8 +164,8 @@ void Kill(void)
|
||||
if (area.MoveArea) {
|
||||
fseek(pAreas, ((area.MoveArea -1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET);
|
||||
fread(&darea, areahdr.recsize, 1, pAreas);
|
||||
sprintf(from, "%s/%s", area.Path, file.Name);
|
||||
sprintf(to, "%s/%s", darea.Path, file.Name);
|
||||
sprintf(from, "%s/%s", area.Path, file.LName);
|
||||
sprintf(to, "%s/%s", darea.Path, file.LName);
|
||||
if ((rc = file_mv(from, to)) == 0) {
|
||||
Syslog('+', "Move %s, area %d => %d", file.Name, i, 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.
|
||||
*/
|
||||
sprintf(from, "%s/.%s", area.Path, file.Name);
|
||||
sprintf(to, "%s/.%s", darea.Path, file.Name);
|
||||
sprintf(from, "%s/.%s", area.Path, file.LName);
|
||||
sprintf(to, "%s/.%s", darea.Path, file.LName);
|
||||
if (file_exist(from, R_OK) == 0)
|
||||
file_mv(from, to);
|
||||
file.Deleted = TRUE;
|
||||
@ -187,15 +187,16 @@ void Kill(void)
|
||||
fwrite(&file, sizeof(file), 1, pFile);
|
||||
iMoved++;
|
||||
} 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 {
|
||||
Syslog('+', "Delete %s, area %d", file.Name, i);
|
||||
Syslog('+', "Delete %s, area %d", file.LName, i);
|
||||
file.Deleted = TRUE;
|
||||
fseek(pFile, - sizeof(file), SEEK_CUR);
|
||||
fwrite(&file, sizeof(file), 1, pFile);
|
||||
iKilled++;
|
||||
sprintf(from, "%s/%s", area.Path, file.Name);
|
||||
sprintf(from, "%s/%s", area.Path, file.LName);
|
||||
unlink(from);
|
||||
}
|
||||
}
|
||||
@ -211,7 +212,7 @@ void Kill(void)
|
||||
if ((pTemp = fopen(sTemp, "a+")) != NULL) {
|
||||
FilesLeft = FALSE;
|
||||
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);
|
||||
FilesLeft = TRUE;
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* File ..................: mbfido/postecho.c
|
||||
* $Id$
|
||||
* Purpose ...............: Post echomail message.
|
||||
* Last modification date : 01-Sep-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@ -57,7 +56,6 @@ extern int do_quiet; /* No tty output */
|
||||
extern int do_unsec; /* Toss unsecure */
|
||||
extern int check_dupe; /* Check dupes */
|
||||
extern time_t t_start; /* Reference time */
|
||||
extern int most_debug; /* Heavy debugging */
|
||||
extern int echo_in; /* Echomail processed */
|
||||
extern int echo_out; /* Echomail forwarded */
|
||||
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);
|
||||
}
|
||||
rewind(qp);
|
||||
most_debug = TRUE;
|
||||
ftn2rfc(f, t, subj, orig, mdate, flags, qp);
|
||||
most_debug = FALSE;
|
||||
fclose(qp);
|
||||
}
|
||||
fclose(nfp);
|
||||
|
Reference in New Issue
Block a user