When I call File.Exists it always return true, even if the file doesn't exists.
The version of Rebex ftp I've purchased is 4.0.5298.0; runtime version is v2.0.50727.
Here is the code:
Rebex.Net.Ftp f = new Rebex.Net.Ftp();
f.LogWriter = new Rebex.FileLogWriter(@"log.txt", Rebex.LogLevel.Debug);
f.Connect("192.168.138.154");
f.Login("simotion", "simotion");
if (f.FileExists("b:\\USER\\SIMOTION\\USER_DIR\\UPP\\UNITDS\\Var_Recipe\\ds000000.dat"))
{
Console.WriteLine("Exists");
}
else
Console.WriteLine("Not Exists");
f.Disconnect();
Console.WriteLine("done");
Console.ReadLine();
And here is the log:
2014-12-16 11:07:32.799 Opening log file.
2014-12-16 11:07:32.799 Using FileLogWriter version 2.0.5298.0.
2014-12-16 11:07:32.834 INFO Ftp(1)[9] Info: Connecting to 192.168.138.154:21 using Ftp 4.0.5298.0.
2014-12-16 11:07:32.834 INFO Ftp(1)[9] Info: Using proxy none.
2014-12-16 11:07:33.020 DEBUG Ftp(1)[9] Info: Connection succeeded.
2014-12-16 11:07:33.050 INFO Ftp(1)[9] Response: 220 Service ready
2014-12-16 11:07:33.070 INFO Ftp(1)[9] Command: USER simotion
2014-12-16 11:07:33.080 INFO Ftp(1)[9] Response: 331 User name ok, need password
2014-12-16 11:07:33.080 INFO Ftp(1)[9] Command: PASS ********
2014-12-16 11:07:33.090 INFO Ftp(1)[9] Response: 230 User logged in
2014-12-16 11:07:33.090 INFO Ftp(1)[9] Command: FEAT
2014-12-16 11:07:33.100 INFO Ftp(1)[9] Response: 500 Unknown cmd FEAT
2014-12-16 11:07:33.110 INFO Ftp(1)[9] Command: TYPE I
2014-12-16 11:07:33.120 INFO Ftp(1)[9] Response: 200 Command OK
2014-12-16 11:07:33.120 INFO Ftp(1)[9] Command: SIZE .
2014-12-16 11:07:33.130 INFO Ftp(1)[9] Response: 451 No such file or directory
2014-12-16 11:07:33.130 INFO Ftp(1)[9] Command: SIZE b:\USER\SIMOTION\USER_DIR\UPP\UNITDS\Var_Recipe\ds000000.dat
2014-12-16 11:07:33.140 INFO Ftp(1)[9] Response: 451 No such file or directory
2014-12-16 11:07:33.140 INFO Ftp(1)[9] Command: PWD
2014-12-16 11:07:33.150 INFO Ftp(1)[9] Response: 257 "/"
2014-12-16 11:07:33.150 INFO Ftp(1)[9] Command: CWD b:\USER\SIMOTION\USER_DIR\UPP\UNITDS\Var_Recipe\ds000000.dat
2014-12-16 11:07:33.160 INFO Ftp(1)[9] Response: 550 Unable to find B:\USER\SIMOTION\USER_DIR\UPP\UNITDS\Var_Recipe\ds000000.dat
2014-12-16 11:07:33.170 INFO Ftp(1)[9] Command: QUIT
2014-12-16 11:07:33.180 INFO Ftp(1)[9] Response: 221 Bye