i want to read files from directory .
The files would be more than 10k+ even 1L + too.
is there any way to do paination logic to read only 1000 mail at a time.
And later pressing next page read next files
readdir() reads whole dir which i dont want