Directory's method countItems() gives correct number of entries, but getFirst(String entry) and getNext(String entry) will give more results as the first two entries returned are "." and "..".
So if using getNext() in a loop will result in more iterations than simply looping with the countItems() method. I only tested the functionality under Windows with VS 15 - so I don't know for Linux.
Directory's method countItems() gives correct number of entries, but getFirst(String entry) and getNext(String entry) will give more results as the first two entries returned are "." and "..".
So if using getNext() in a loop will result in more iterations than simply looping with the countItems() method. I only tested the functionality under Windows with VS 15 - so I don't know for Linux.