Skip to content

Commit 5f00b1b

Browse files
again fix filepaths remote
1 parent a5d40f3 commit 5f00b1b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

FileSyncLibNet/SyncProviders/SmbLibProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,26 +173,26 @@ public override void SyncSourceToDest()
173173
File.Delete(file);
174174
}
175175
}
176-
foreach (var remoteFile in remoteFiles)
176+
foreach (var remoteFileFromSource in remoteFiles)
177177
{
178178
bool copy = false;
179-
var realFilePath = remoteFile.Trim('\\').Replace('/', '\\');
180-
179+
var realFilePath = remoteFileFromSource.Trim('\\').Replace('/', '\\');
180+
var remoteFileWithSource = Path.Combine(SourcePath, remoteFileFromSource).Trim('\\');
181181
var localFile = Path.Combine(jobOptions.DestinationPath, realFilePath.TrimStart('\\', '/')).Replace('/', '\\');
182182
var exists = File.Exists(localFile);
183-
_ = FileExists(remoteFile, out long remoteSize);
183+
_ = FileExists(remoteFileWithSource, out long remoteSize);
184184
var size = exists ? new FileInfo(localFile).Length : 0;
185185
copy = !exists || size != remoteSize;
186186
if (copy)
187187
{
188188
logger.LogDebug("Copy {A}", realFilePath);
189189
try
190190
{
191-
ReadFile(Path.Combine(SourcePath, remoteFile), localFile);
191+
ReadFile(remoteFileWithSource, localFile);
192192
copied++;
193193
if (jobOptions.DeleteSourceAfterBackup)
194194
{
195-
DeleteFile(remoteFile);
195+
DeleteFile(remoteFileWithSource);
196196
}
197197
}
198198
catch (Exception exc)

0 commit comments

Comments
 (0)