I'm using the following code to try and get all files from ftp using Ruby.

files = ftp.list()

files.each do |file|
  ftp.gettextfile(file)
end

The problem is ftp.list returns a whole line of information, not just the filename e.g.

-rw-r--r-- 1 ftp ftp              0 May 31 11:18 brett.txt

How do I extract the filname from this string?

Many thanks

Edit
Report