From: "Hal E. Fulton" Date: 2003-05-04T01:53:10+09:00 Subject: Re: Cross platform `ls -t` ----- Original Message ----- From: "gabriele renzi" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Saturday, May 03, 2003 11:31 AM Subject: Cross platform `ls -t` > Is there a way using Dir to have a list of directory entries sorted by > time? > > What I'd like to have is a `ls -t` that works even on windows > (and no, I don't want ls.exe ;) Mmm. Something like this (untested): list = Dir["**"].sort {|x,y| File.stat(x).mtime < File.stat(y).mtime } Of course, it's inefficient -- a Schwartzian transform would make it faster. Hal