diff --git a/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles.cs b/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles.cs index de63901..8586448 100644 --- a/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles.cs +++ b/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles/Frends.FTP.DeleteFiles.cs @@ -167,14 +167,11 @@ private static async Task> GetFiles(FtpClient ftp, Input input, C { cancellationToken.ThrowIfCancellationRequested(); - if (file.Type == FtpFileSystemObjectType.Link || file.Type == FtpFileSystemObjectType.Directory) + if (file.Name != "." && file.Name != ".." && file.Type != FtpFileSystemObjectType.File) continue; // skip directories and links - if (file.Name != "." && file.Name != ".." && file.Type == FtpFileSystemObjectType.File) - { - if (Regex.IsMatch(file.Name, regexStr, RegexOptions.IgnoreCase) || FileMatchesMask(file.Name, input.FileMask)) - files.Add(new FileItem(file)); - } + if (Regex.IsMatch(file.Name, regexStr, RegexOptions.IgnoreCase) || FileMatchesMask(file.Name, input.FileMask)) + files.Add(new FileItem(file)); } return files;