Mark Thomas wrote:
> On Apr 14, 4:55am, Idealone Ideally <sheka... / gmail.com> wrote:
>> filename = "file1"
>> 1) Download multiple files from a given directory.
>> 2) Download files by giving wild characters (eg: *.xls or *.txt)
>>
>> Please let me know if there is a better way or easier way to achieve
>> these tasks.
> 
> Not all that familiar with the library, but I do recall there is a
> list method that accepts wildcards. Try something like this:
> 
> files = ftp.list('*.xls')
> files.each do |filename|
>   ftp.getbinaryfile(filename, filename)
> end
> 
> -- Mark

I tried using the above code, i am getting some error:

NetBeans 6.5/ruby2/jruby-1.1.4/lib/ruby/1.8/net/ftp.rb:494:in `open': Is 
a directory - Is a directory (Errno::EISDIR)
        from C:/Program Files/NetBeans 
6.5/ruby2/jruby-1.1.4/lib/ruby/1.8/net/ftp.rb:494:in `getbinaryfile'
        from C:\user\workspace\qa\Cvis-ruby\lib\ftp_config.rb:25
        from C:\user\workspace\qa\Cvis-ruby\lib\ftp_config.rb:24:in 
`each'
        from C:\user\workspace\qa\Cvis-ruby\lib\ftp_config.rb:24


-- cheers
-- 
Posted via http://www.ruby-forum.com/.