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

@@ -318,10 +318,10 @@ int AddFile(struct FILE_record f_db, int Area, char *DestPath, char *FromPath, c
*/
mkdirs(DestPath, 0775);
if (file_exist(DestPath, F_OK) == 0) {
WriteError("File %s already exists in area %d", f_db.Name, Area);
if ((file_exist(DestPath, F_OK) == 0) || (file_exist(LinkPath, F_OK) == 0)) {
WriteError("File %s (%s) already exists in area %d", f_db.Name, f_db.LName, Area);
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;
}