sorting graphic files by time

I am running a website hosted by virtualave (they run freebsd on their servers i believe).  I am try to get a cgi script together that will retrieve a listing of files (.gif & .jpg only) in a specified directory.  These files must be sorted by date with the most recent file being listed first.
LVL 1
AikemaAsked:
Who is Participating?
 
kawinConnect With a Mentor Commented:
It easy to use unix command to do that


foreach $file (`ls -lt *jpg *gif`) {

    #do what ever you want

}
0
 
ozoCommented:
for( sort
0
All Courses

From novice to tech pro — start learning today.