pattern: Add support for files in buffer_pattern argument.