FtpTask - wrong Path to the local folder. (Bug #369)

Added by Andrey Belyakov 8 months ago. Updated 8 months ago.

Status:New Start date:11/02/2017
Priority:Normal Due date:
Assignee:- % Done:


Category:Publisher Spent time: -
Target version:1.9
Affected version:1.8.5


Hi Folks,

Look like there is one more problem in FtpTask.

Problem is: sometime I get wrong Path to the local folder.

For example:
Physical path in Win7 is 'C:\Integration\Project6\Sources\bin\Debug'
Local folder after getting into subfolder in the task looks like: 'C:\Integration\Project6\Sources/bin/Debug' (pay attention to slash's)
Cutting out a relative part of the Path gives: 'ebug'

Code are in FtpLib.cs
folders = System.IO.Directory.GetDirectories(localFolder);

// remove the local folder value, so we can work relative
for (int i = 0; i <= folders.Length - 1; i++) {
string folder = folders[i];
// here ae a potential problem
// localFolder may have '\' and '/' as folder separators
// and when separators are mixed - time to time it will be interpreted as
// one char longer string.
// need to test Remove() for all options.
folders[i] = folders[i].Remove(0, localFolder.Length);
Log.Debug("Folder: original '{0}' and relative '{1}'", folder, folders[i]);


Also available in: Atom PDF