-
-
Notifications
You must be signed in to change notification settings - Fork 683
Open
Description
If the Unix and Linux operating systems allow you to create files with the same name but different case. For example.
[C:\tmp\TEST\check.txt] <- [/TEST/check.txt] [768 Bytes/seconds] [6 Bytes]
[C:\tmp\TEST\check.txt] <- [/TEST/CHeck.txt] [711 Bytes/seconds] [6 Bytes]
Then when downloading the file on Windows, there will be an error here.
FluentFTP\Client\Modules\FileDownloadModule.cs
/// <summary>
/// Create an FtpResult object for the given file to be downloaded, and check if the file passes the rules.
/// </summary>
private static void RecordFileToDownload(BaseFtpClient client, List<FtpRule> rules, List<FtpResult> results, Dictionary<string, bool> shouldExist, List<FtpResult> toDownload, FtpListItem remoteFile, string localFile, string remoteFilePath = null) {
// create the result object
FtpResult result;
if (remoteFile != null) {
result = new FtpResult() {
Type = remoteFile.Type,
Size = remoteFile.Size,
Name = remoteFile.Name,
RemotePath = remoteFile.FullName,
LocalPath = localFile,
IsDownload = true,
};
}
else {
result = new FtpResult() {
Type = FtpObjectType.File,
Size = 0,
Name = remoteFilePath.GetFtpFileName(),
RemotePath = remoteFilePath,
LocalPath = localFile,
IsDownload = true,
};
}
// record the file
results.Add(result);
// only download the file if it passes all the rules
if (FileRuleModule.FilePassesRules(client, result, rules, false, remoteFile)) {
// record that this file/folder should exist
shouldExist.Add(localFile.ToLower(), true);
// only files are processed
toDownload.Add(result);
}
}
This localFile.ToLower()
Because Net Core will not allow you to add keys with the same name to the dictionary.