Issue #1 added the possibility to define the file_name with a function.