/// <summary> /// Sends a MLST command. /// </summary> /// <param name="ftpClient">The FTP client.</param> /// <param name="path">The path.</param> /// <returns></returns> public static string Mlst(this FtpClient ftpClient, FtpPath path) { var reply = ftpClient.Process(session => { session.CheckProtection(FtpProtection.ControlChannel); return(session.Expect(session.SendCommand("MLST", ftpClient.GetPlatform(session).EscapePath(path.ToString())), 250)); }); return(reply.Lines[1]); }
/// <summary> /// Sends a STAT command. /// </summary> /// <param name="ftpClient">The FTP client.</param> /// <param name="path">The path.</param> /// <returns></returns> public static IEnumerable <string> Stat(this FtpClient ftpClient, FtpPath path) { var reply = ftpClient.Process(session => { session.CheckProtection(FtpProtection.ControlChannel); return(session.Expect(session.SendCommand("STAT", ftpClient.GetPlatform(session).EscapePath(path.ToString())), 213, 211)); }); return(reply.Lines.Skip(1).Take(reply.Lines.Length - 2)); }