Martian eyrie

August 30, 2007

Ruby zone » Рекурсивный листинг директорий

Filed under: RubyOnRails

Ruby zone » Recursive directory listing В PHP или других языках чтобы получить содержимое директории и всех ее поддиректорий, нужно написать несколько строк кода, в Ruby же это займет 2 строчки:

require ‘find’
Find.find(’./’) do |f| p f end

- это напечатает содержимое текущей директории и всех ее поддиректорий.

Или даже короче, можно использовать нотацию ’**’ : p Dir[’**/*.*’]
Сколько нужно написать кода для того же на PHP или Java?

Comments »

The URI to TrackBack this entry is: http://eyrie.blogsome.com/2007/08/30/p183/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Minz Meyer