# То же самое, но на julia using Logging debuglogger = ConsoleLogger(stderr, Logging.Debug) global_logger(debuglogger) function new_name(name) matches = Dict( "Сек" => r"(.+) Сек.*", "Сцен" => r"(.+) Сцен.*", "Голые" => r"(.+) Голые.*", "Откро" => r"(.+) Откро.*", "Посте" => r"(.+) Посте.*", "Изнас" => r"(.+) Изнас.*", "Инцес" => r"(.+) Инцес.*", "Лесб" => r"(.+) Лесб.*", "Эро" => r"(.+) Эро.*" ) for (k, v) in matches if contains(name, k) base, ext = splitext(name) new_name = replace(base, v => s"\1") # @debug base, new_name return string(new_name, ext) end end return name end function valid_file(filename) valids = [".mp4", ".webm", ".mpeg"] _, ext = splitext(filename) return ext in valids end # file_info function returns information from file function file_info(filename) _, ext = splitext(filename) info = stat(filename) m = Dict( "filename" => filename, "size" => info.size, "mtime" => info.mtime, "ctime" => info.ctime, "ext" => ext, ) return m end function check_file(filename) println(filename) meta = file_info(filename) println(meta) end # -------- основная программа -------------- dir = "d:\\vids\\ero" @info "Обработка каталога: $dir" files = readdir(dir, join=true) for file in filter(valid_file, files) meta = check_file(file) end