class Net::FTP::List::Netware

Parse Netware like FTP LIST entries.

MATCHES

d [RWCEAFMS] dpearce                          512 Jun 27 23:46 public.www

Constants

REGEXP

Stolen straight from the ASF's commons Java FTP LIST parser library. svn.apache.org/repos/asf/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/

Public Class Methods

parse(raw, timezone: :utc) click to toggle source

Parse a Netware like FTP LIST entries.

# File lib/net/ftp/list/netware.rb, line 21
def self.parse(raw, timezone: :utc)
  match = REGEXP.match(raw.strip) or return false
  type  = match[1] == 'd' ? :dir : :file

  emit_entry(
    raw,
    mtime: parse_time(match[5], timezone: timezone),
    filesize: match[4].to_i,
    type: type,
    basename: match[9],
  )
end