I want to keep a list of existing log files from the log directory. whenever this list reached the max limitation, say 20 files, I will delete the oldest log file.
Each time when application is launched, it will check the log directory and keep all log file names in a list. but this list should be sorted with the creation time.
what's the good way to do this? thanks,