I want to be able to read all files in a folder but only 10 at a time.I have the code to read all files in a folder.But now I want to change it to read all files but only 10 at a time.It will read 10 files, then next 10 files ,then next 10 files and in the end the remaing files (10 or less). How to do this.
Well you can keep a counter and increment everytime doSomething() is called. Pause when it reaches 10.
Then remove the 10 read files from the array and recursively call the method again.