Fixed file move bug if destination existed
This commit is contained in:
parent
03bc6ee9d0
commit
773d74d55c
@ -18,6 +18,8 @@ v0.39.1 22-Oct-2003
|
|||||||
mbfile:
|
mbfile:
|
||||||
When the areanumber with the adopt command was not given, the
|
When the areanumber with the adopt command was not given, the
|
||||||
help is displayed instead of trying area 0 that doesn't exist.
|
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:
|
mbsetup:
|
||||||
In node editor, fixed error message when there was no more
|
In node editor, fixed error message when there was no more
|
||||||
|
3
TODO
3
TODO
@ -117,9 +117,6 @@ mbcico:
|
|||||||
U: Fix binkp file resume when mbcico silently dies.
|
U: Fix binkp file resume when mbcico silently dies.
|
||||||
|
|
||||||
mbfile:
|
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: Add a check to see if the magic filenames are (still) valid.
|
||||||
|
|
||||||
L: Update <filespec> <area> <-touch>
|
L: Update <filespec> <area> <-touch>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose: File Database Maintenance - Move a file
|
* Purpose: File Database Maintenance - Move a file
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2002
|
* Copyright (C) 1997-2003
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -152,6 +152,15 @@ void Move(int From, int To, char *File)
|
|||||||
tothumb = xstrcat(tothumb, (char *)"/.");
|
tothumb = xstrcat(tothumb, (char *)"/.");
|
||||||
tothumb = xstrcat(tothumb, fdb.Name);
|
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));
|
temp2 = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp2, "%s/fdb/fdb%d.temp", getenv("MBSE_ROOT"), From);
|
sprintf(temp2, "%s/fdb/fdb%d.temp", getenv("MBSE_ROOT"), From);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user