GetFiles() transfers empty File
Hi Guys,
I'm starting with the WINSCP Lib and it looks quite good.
Now I'm using the WinSCP Client to compare what I am doing.
I have a simple text file on an sftp with a few lines of content; when I transfer it, it arrives beeing an empty file.
Here is the code I use:
found it, its evil!
Session.FileExists will return true for a relative path
Session.GetFiles will just create an empty file
[/b]
I'm starting with the WINSCP Lib and it looks quite good.
Now I'm using the WinSCP Client to compare what I am doing.
I have a simple text file on an sftp with a few lines of content; when I transfer it, it arrives beeing an empty file.
Here is the code I use:
using (var session = Connect())
{
if(!session.FileExists(fileName))
{
throw new FileNotFoundException(fileName);
}
var tmp = Path.GetTempFileName();
var result = session.GetFiles(fileName, tmp);
if(!result.IsSuccess)
{
throw new AggregateException(result.Failures);
}
return tmp;
}found it, its evil!
Session.FileExists will return true for a relative path
Session.GetFiles will just create an empty file
[/b]