Skip to content

Commit

Permalink
Fixed bug with IsRegularFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Riku Virtanen committed Sep 5, 2024
1 parent 43d289a commit 7388eae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Frends.SFTP.DownloadFiles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.13.0] - 2024-09-05
### Fixed
- Fixed issue with certain SFTP servers which did not use IsRegularFile property on files by modifying the logic to check that the file is not anything else than a regular file.

## [2.12.0] - 2024-08-16
### Updated
- Updated Renci.SshNet library to version 2024.1.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,15 @@ private List<FileItem> ListFiles(SftpClient sftp, Source source, string director

if (file.Name.Equals(".") || file.Name.Equals("..")) continue;

if (file.IsRegularFile && (file.Name.Equals(source.FileName) || Util.FileMatchesMask(Path.GetFileName(file.FullName), source.FileName)))
if (file.IsDirectory && source.IncludeSubdirectories)
fileItems.AddRange(ListFiles(sftp, source, file.FullName, cancellationToken));

if (!file.IsDirectory && !file.IsSocket && !file.IsSymbolicLink && !file.IsBlockDevice && !file.IsCharacterDevice && !file.IsNamedPipe && (file.Name.Equals(source.FileName) || Util.FileMatchesMask(Path.GetFileName(file.FullName), source.FileName)))
{
var item = new FileItem(file);
_logger.NotifyInformation(_batchContext, $"FILE LIST {item.FullPath}");
fileItems.Add(item);
}

if (file.IsDirectory && source.IncludeSubdirectories)
fileItems.AddRange(ListFiles(sftp, source, file.FullName, cancellationToken));
}

return fileItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AssemblyName>Frends.SFTP.DownloadFiles</AssemblyName>
<RootNamespace>Frends.SFTP.DownloadFiles</RootNamespace>

<Version>2.12.0</Version>
<Version>2.13.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down

0 comments on commit 7388eae

Please sign in to comment.