Better destination file exist check

This commit is contained in:
Michiel Broek 2005-01-02 14:53:08 +00:00
parent 4e7fdbf288
commit a91c5a1913
2 changed files with 5 additions and 3 deletions

View File

@ -38,6 +38,8 @@ v0.71.1 28-Nov-2004
Better error reporting if something is wrong. Better error reporting if something is wrong.
The import command now also figures out the difference between The import command now also figures out the difference between
8.3 and long filenames and does the right thing during import. 8.3 and long filenames and does the right thing during import.
During file import the destination is tested for both 8.3 and
LFN for an existing file. Improved error reporting.
mbfido: mbfido:
In rfc2ftn a debug logmessage added to check for unrecognised In rfc2ftn a debug logmessage added to check for unrecognised

View File

@ -318,10 +318,10 @@ int AddFile(struct FILE_record f_db, int Area, char *DestPath, char *FromPath, c
*/ */
mkdirs(DestPath, 0775); mkdirs(DestPath, 0775);
if (file_exist(DestPath, F_OK) == 0) { if ((file_exist(DestPath, F_OK) == 0) || (file_exist(LinkPath, F_OK) == 0)) {
WriteError("File %s already exists in area %d", f_db.Name, Area); WriteError("File %s (%s) already exists in area %d", f_db.Name, f_db.LName, Area);
if (!do_quiet) if (!do_quiet)
printf("\nFile %s already exists in area %d\n", f_db.Name, Area); printf("\nFile %s (%s) already exists in area %d\n", f_db.Name, f_db.LName, Area);
return FALSE; return FALSE;
} }