Can this be made `const`?
Also, the string could be given as  `const &`
The `fname` variable in this method can also be `const`

Why is the file_name incomplete? (I.e. why do you have to add ".txt" manually?)
It looks a bit like an exploit if you need the file_name-string sometimes with extension and sometimes without. I don't know what you are actually doing but this kind of seems to indicate that something may not be quite right here.