edgeport - v1.0.3
    Preparing search index...

    Function parseListLine

    • Parses one Unix ls -l listing line into an FtpEntry.

      Recognizes the conventional 9-field long format: a permission string (whose first character is d for directories), link count, owner, group, size, three date fields, and the name (which may itself contain spaces). Parsing is tolerant: a line it cannot read is returned with its raw text and a best-effort name (the last whitespace-delimited token), no size, and isDirectory taken from a leading d if present.

      Parameters

      • line: string

        A single listing line, stripped of its CRLF.

      Returns FtpEntry

      The parsed entry; size is omitted when it cannot be determined.

      1.0.0

      parseListLine('-rw-r--r-- 1 me grp 1234 Jun 28 12:00 readme.txt');
      // { name: 'readme.txt', size: 1234, isDirectory: false, raw: '...' }
      parseListLine('drwxr-xr-x 2 me grp 4096 Jun 28 12:00 pub');
      // { name: 'pub', size: 4096, isDirectory: true, raw: '...' }