1
Vote

RemoteDirectoryInfo.GetFiles and GetDirectories populate only the name not the path

description

GetFile populates the RemoteFileInfo object with only the filename not the path.
public RemoteFileInfo[] GetFiles(string searchPattern)
{
string[] ret = RemoteDirectory.GetFiles(base.Device, base.FullPath, searchPattern);
return Array.ConvertAll<string, RemoteFileInfo>(ret, delegate(string s) { return new RemoteFileInfo(base.Device, s); });
}
Changing the delegate function such as below would cause both the name and the full path
to be available via the properties as I believe it was intended.
public RemoteFileInfo[] GetFiles(string searchPattern)
{
string[] ret = RemoteDirectory.GetFiles(base.Device, base.FullPath, searchPattern);
return Array.ConvertAll<string, RemoteFileInfo>(ret, delegate(string s) { return new RemoteFileInfo(base.Device, Path.Combine(this.Name,s)); });
}
GetDirectories is done in a similar manner.

comments