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

Hi, here's my trivial change.