3 lines
227 B
Text
3 lines
227 B
Text
Selects a random file from given directory using reservoir sampling algorithm.
|
|
This means directory contents doesn't need to be read in memory and then sorted
|
|
and so will perform much better than find+sort for big directories.
|