PDA

View Full Version : Link to newest file in a directory


androvski
05-17-2005, 09:19 PM
Hi

I have a list of html files in a directory on the server that are called

01.html
02.html
03.html
04.html
05.html

and the list grows over time.

Then i have a frameset which needs to open the file with the highest number filename (esentially the most recent file) in one of its frames.

The highest filename will probably be about 30.html

Can anyone suggest a tidy algorythm that will do it?

If you are going to delete this post can you suggest where else I can post it.

Thanks Andy

gph
05-17-2005, 11:34 PM
JavaScript runs on the clients computer. It can't loop through files on the server. You need to find the newest page on the server.

androvski
05-18-2005, 01:17 AM
Thanks

So if Javascript cant do it, what can?

Andy

Basscyst
05-18-2005, 01:24 AM
A server side language like PHP or ASP.

Basscyst

androvski
05-18-2005, 01:33 AM
thanks, will perl/cgi do it too?

Andy

jbot
05-18-2005, 11:22 AM
thanks, will perl/cgi do it too?

what do you think? if you looked up an advance Perl tutorial on the Net, you'd see exactly how powerful it is in relation to server filesystem management and thus you wouldn't need to ask in the forum.