diff --git a/ChangeLog b/ChangeLog index 7dcda1ac..cd7a8140 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ v0.39.1 22-Oct-2003 mbfile: When the areanumber with the adopt command was not given, the help is displayed instead of trying area 0 that doesn't exist. + With the file move command if the file already exists in the + destination area, the move is refused. mbsetup: In node editor, fixed error message when there was no more diff --git a/TODO b/TODO index 036f5a08..12787efb 100644 --- a/TODO +++ b/TODO @@ -117,9 +117,6 @@ mbcico: U: Fix binkp file resume when mbcico silently dies. mbfile: - U: With file move and file already exists, there is an error - cannot create symbolic link , unknown error 4294968295. - L: Add a check to see if the magic filenames are (still) valid. L: Update <-touch> diff --git a/mbfido/mbfmove.c b/mbfido/mbfmove.c index 53d7d65e..5b5e418d 100644 --- a/mbfido/mbfmove.c +++ b/mbfido/mbfmove.c @@ -4,7 +4,7 @@ * Purpose: File Database Maintenance - Move a file * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2003 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -152,6 +152,15 @@ void Move(int From, int To, char *File) tothumb = xstrcat(tothumb, (char *)"/."); tothumb = xstrcat(tothumb, fdb.Name); + if (file_exist(topath, F_OK) == 0) { + Syslog('-', "%s", topath); + Syslog('-', "%d", file_exist(topath, F_OK)); + WriteError("File %s already exists in area %d", File, To); + if (!do_quiet) + printf("File %s already exists in area %d\n", File, To); + die(MBERR_COMMANDLINE); + } + temp2 = calloc(PATH_MAX, sizeof(char)); sprintf(temp2, "%s/fdb/fdb%d.temp", getenv("MBSE_ROOT"), From);