Method: Net::FTP#list
- Defined in:
- lib/extensions/net-http/net/ftp.rb
#list(*args, &block) ⇒ Object Also known as: ls, dir
Returns an array of file information in the directory (the output is like ‘ls -l`). If a block is given, it iterates through the listing.
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/extensions/net-http/net/ftp.rb', line 673 def list(*args, &block) # :yield: line cmd = "LIST" args.each do |arg| cmd = cmd + " " + arg.to_s end if block retrlines(cmd, &block) else lines = [] retrlines(cmd) do |line| lines << line end return lines end end |