How to select a random file from a directory in System Verilog/UVM?

Hi,

Can anyone please tell me how to read a random file from a directory in system verilog?
Because I know how to read a particular file but do not know how to select a random file from a directory.

Regards,
Suresh

In reply to Nemili Suresh Reddy:

I have to assume your random files are from a known set of filenames, correct? You can put those filenames in an array of strings and randomly choose an index into the array. You can also put the list of filenames in another file, and use $fgets to read the filenames into an array.