ArxOne / FTP

Simple FTP client
MIT License
37 stars 15 forks source link

GetEntry fails on some servers #24

Closed kris-g closed 8 years ago

kris-g commented 8 years ago

In ProcessGetEntry there is a status code check which doesn't seem to align with my FTP server...

private static FtpEntry ProcessGetEntry(FtpSession session, FtpPath path) { session.CheckProtection(FtpProtection.ControlChannel); var reply = session.SendCommand("STAT", session.Connection.Client.GetPlatform(session).EscapePath(path.ToString())); if (reply.Code != 213 || reply.Lines.Length <= 2) return null; // now get the type: the first entry is "." for folders or file itself for files/links var entry = EnumerateEntries(session.Connection.Client, path, reply.Lines.Skip(1), ignoreSpecialEntries: false).First(); // actually, it's always good here return new FtpEntry(path, entry.Size, entry.Type, entry.Date, entry.Target); }

My FTP server seems to return status code 211 instead of 213 as the code expects. Everything else in the response is fine, I get full details of the remote file I queried.

picrap commented 8 years ago

Not sure this is a bug, however, if accepting a 211 can make you happy, consider it done :smile:

picrap commented 8 years ago

This is done in 1.8.2.