can a mulit-page dir listing be done?

liunx

Guest
Hello,
I am trying to to list a folder on my page and its all going well except some of my folders hav over 300 files and it takes a few sec. for the data to show up. So I wanted to know, is there a way to split the dir listing over more than one page.

I saw that the rewinddir will rewind the dir listing position so i was thinking is there an easy way to move it forward

Thanks
Dongrab the dir into an array using scandir then break it into chunks using array_chunk.hmm i dont think that will speed it up because it will still be reading the entire dir at one time ... now im using the old way to read the dir .. would scandir be faster??

Thanksyes it will still be reading the entire dir at one time but you will then be able to paginate the listing, which what i thought you were getting at.yeah m looking for that and speed up listing because @ 500 files it takes about 10sec to display so i was thinking reading the first 100 on page one then page 2 would read files 101-200

hope that makes sencethe bottleneck is not the PHP reading the files on the server, it is sending a giant list of those files to the client. that is precisely why you want to paginate. i have scripts that read server dirs that have 1000's a files that excute instantly because they only return a small bit to the client.ohhh mind if i tyake a look @ them :)

cause i would like to have them all on one page

you can look @ <!-- m --><a class="postlink" href="http://dlgnetworks.com:8080/?Catagory=Game/Remixes">http://dlgnetworks.com:8080/?Catagory=Game/Remixes</a><!-- m -->

all im listing is file name and making 3 links

ohh and dont worry all file are public domain

Thanks for your help
Don
 
Back
Top