I have this code:
all_backups = dir.entries[2..-1].sort.reverse
max_backups = 20
unwanted_backups = all_backups[max_backups..-1] || []
I think it gets all entries in a defined folder. What is [2..-1]? What is all_backups[max_backups..-1] || []?
all_backupsor ofunwanted_backups? And may I know what do you mean by oldest? Can you please tell where the oldest entries be located? (by way of array index)