A lot of the features that I have planned are not yet implemented but for the most part this program is a functional prototype which should accept most FTP commands. If I've missed some FTP commands that you would like to see please let me know in this thread or open up a Feature Request. Being an alpha release the next release will have many tweaks and changes plus if there are some downloads and some errors encountered that I don't catch, please let me know by putting in a bug report.
I hope this software proves useful to you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Instead of using Datasets in the Dir(string mask) function, which produces errors in special cases (for examle a "file*.ext" pattern), I use the following helper class:
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace FTPClient
{
public class FileSystemPatterns
{
private string _SearchPattern;
public FileSystemPatterns(string SearchPattern)
{
_SearchPattern = string.Format("^{0}$",
SearchPattern.Replace(".", @"\.").Replace("*", ".*").Replace("?", ".?").Replace("$", @"\$"));
}
public string[] GetMatches(string[] entries)
{
return Array.FindAll<string>(entries, PatternMatch);
}
public List<string> GetMatches(List<string> entries)
{
return entries.FindAll(PatternMatch);
}
I'll look into this. I'm currently going to work on a port to C# of the ftp4che java library and then migrate this scriptable clients backend to the new library once its finished so I'll look at your implementation and see if I can squeeze it into the library during the port. I haven't messed with this project for awhile now but I think you may be talking about a function located in the FTPClient library, yeah? But yeah, I'll see about using your implementation with the new backend.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A lot of the features that I have planned are not yet implemented but for the most part this program is a functional prototype which should accept most FTP commands. If I've missed some FTP commands that you would like to see please let me know in this thread or open up a Feature Request. Being an alpha release the next release will have many tweaks and changes plus if there are some downloads and some errors encountered that I don't catch, please let me know by putting in a bug report.
I hope this software proves useful to you.
Instead of using Datasets in the Dir(string mask) function, which produces errors in special cases (for examle a "file*.ext" pattern), I use the following helper class:
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace FTPClient
{
public class FileSystemPatterns
{
private string _SearchPattern;
public FileSystemPatterns(string SearchPattern)
{
_SearchPattern = string.Format("^{0}$",
SearchPattern.Replace(".", @"\.").Replace("*", ".*").Replace("?", ".?").Replace("$", @"\$"));
}
public string[] GetMatches(string[] entries)
{
return Array.FindAll<string>(entries, PatternMatch);
}
public List<string> GetMatches(List<string> entries)
{
return entries.FindAll(PatternMatch);
}
private bool PatternMatch(string entry)
{
return Regex.IsMatch(System.IO.Path.GetFileName(entry), _SearchPattern, RegexOptions.IgnoreCase);
}
}
}
Inside the program, it can be easily accessed via
public List<string> Dir(String mask)
{
List<string> tmpList = Dir();
FileSystemPatterns fp = new FileSystemPatterns(mask);
return fp.GetMatches(tmpList);
}//Dir
That makes it much quicker and more powerful than the DataSet.
I'll look into this. I'm currently going to work on a port to C# of the ftp4che java library and then migrate this scriptable clients backend to the new library once its finished so I'll look at your implementation and see if I can squeeze it into the library during the port. I haven't messed with this project for awhile now but I think you may be talking about a function located in the FTPClient library, yeah? But yeah, I'll see about using your implementation with the new backend.