Есть ли способ получить содержимое папки в определенном порядке? Я бы хотел, чтобы массив словарей атрибутов файлов (или только имена файлов) упорядочивался по дате.
Сейчас я делаю так:
- получить массив с именами файлов
- получить атрибуты каждого файла
- сохранить путь к файлу и изменить дату в словаре с датой в качестве ключа
Затем мне нужно вывести словарь в порядке дат, но я задался вопросом, есть ли более простой способ? Если нет, есть ли фрагмент кода где-нибудь, который сделает это для меня?
Спасибо.