Andreas S. wrote:
>
> Dir['/share/music/**/*.mp3', '/share/music/*.mp3'].sort_by{|f| 
> File.atime}.reverse[0,10]

this one seems to work

a = Dir['E:/Music/*.mp3'].sort_by{|f| File.atime(f)}.reverse[0,10]
a.each {|f| p f, File.atime(f)}

except on Windows Vista, I noticed 2 things:

1) The filenames with internation characters come out as ?????.mp3
   and therefore  File.atime(f) will fails afterwards.

2) The access time of .mp3 or .txt or .txt is unchanged even after the 
file is played, or run  (such as by ruby test_dir.rb), or looked at by 
Notepad.




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