edgeport - v1.0.3
    Preparing search index...

    Function parseReply

    • Parses one logical FTP control reply from its raw lines.

      A reply is either a single NNN text line or a multiline block that opens with NNN-... and continues until a line beginning NNN (code followed by a space). The leading 3-digit code is taken from the first line; its first digit classifies the reply (1=preliminary, 2=complete, 3=more input, 4/5=error).

      Parameters

      • lines: string[]

        The reply lines, each already stripped of its CRLF.

      Returns FtpReply

      The parsed code and joined text.

      If lines is empty or the first line has no 3-digit code.

      1.0.0

      parseReply(['257 "/home/me" is current directory']); // { code: 257, text: '"/home/me" ...' }
      parseReply(['211-Features:', ' SIZE', '211 End']); // { code: 211, text: 'Features:\n SIZE\nEnd' }