From 5f00b1b6462c44cd031fc8a33769170ebf164dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=BCffel?= Date: Tue, 7 Nov 2023 13:40:22 +0100 Subject: [PATCH] again fix filepaths remote --- FileSyncLibNet/SyncProviders/SmbLibProvider.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FileSyncLibNet/SyncProviders/SmbLibProvider.cs b/FileSyncLibNet/SyncProviders/SmbLibProvider.cs index 297a15c..40573bf 100644 --- a/FileSyncLibNet/SyncProviders/SmbLibProvider.cs +++ b/FileSyncLibNet/SyncProviders/SmbLibProvider.cs @@ -173,14 +173,14 @@ public override void SyncSourceToDest() File.Delete(file); } } - foreach (var remoteFile in remoteFiles) + foreach (var remoteFileFromSource in remoteFiles) { bool copy = false; - var realFilePath = remoteFile.Trim('\\').Replace('/', '\\'); - + var realFilePath = remoteFileFromSource.Trim('\\').Replace('/', '\\'); + var remoteFileWithSource = Path.Combine(SourcePath, remoteFileFromSource).Trim('\\'); var localFile = Path.Combine(jobOptions.DestinationPath, realFilePath.TrimStart('\\', '/')).Replace('/', '\\'); var exists = File.Exists(localFile); - _ = FileExists(remoteFile, out long remoteSize); + _ = FileExists(remoteFileWithSource, out long remoteSize); var size = exists ? new FileInfo(localFile).Length : 0; copy = !exists || size != remoteSize; if (copy) @@ -188,11 +188,11 @@ public override void SyncSourceToDest() logger.LogDebug("Copy {A}", realFilePath); try { - ReadFile(Path.Combine(SourcePath, remoteFile), localFile); + ReadFile(remoteFileWithSource, localFile); copied++; if (jobOptions.DeleteSourceAfterBackup) { - DeleteFile(remoteFile); + DeleteFile(remoteFileWithSource); } } catch (Exception exc)