There may be some confusion here due to the word "lifetime". A Rust lifetime (those '_ things) as part of a type (like &'_ mut File) is typically describing the duration of a borrow. It it not describing the liveness scope of a value, like when something will be destructed.
Borrow checking is a pass-or-fail compile time check, and is not allowed to change the semantics of a program. So changing the annotated lifetimes in a Rust program cannot make values live longer.
If you want to keep a value alive, you're dealing with ownership. The way to make the File live for longer is to give ownership of it away to something that lasts longer (which is what @jofas has done).
(Rust references (&_, &mut) are borrows of what they point to, not owners.)