Fixed file move bug if destination existed

This commit is contained in:
Michiel Broek 2003-11-02 12:13:08 +00:00
parent 03bc6ee9d0
commit 773d74d55c
3 changed files with 12 additions and 4 deletions

View File

@ -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

3
TODO
View File

@ -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 <name>, unknown error 4294968295.
L: Add a check to see if the magic filenames are (still) valid.
L: Update <filespec> <area> <-touch>

View File

@ -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);