[ruby-it] Blocchi e cicli

Antonio Cangiano acangiano a gmail.com
Dom 21 Set 2008 21:14:21 CEST


2008/9/21 Massimo Arnaudo <lavoro a massimo.arnaudo.name>:
> Ciao a tutti,
> lanciando il file ho un errore:

Se ho capito cosa vuoi fare, prova con questo:

require 'pathname'

elenco_file = Pathname.new('c:\Download\\').entries
elenco_file_txt = elenco_file.select {|entry| entry.to_s =~ // }.sort
puts "Non esistono file txt" if elenco_file_txt.empty?
elenco_file_txt.each {|file| puts file }


Ciao,
Antonio
-- 
http://antoniocangiano.com - Zen and the Art of Programming
http://belifesavvy.com - Be life savvy: Life's missing manual
http://stacktrace.it - Aperiodico di resistenza informatica
Currently writing "Ruby on Rails for Microsoft Developers" for Wrox.


More information about the Ml mailing list