it might be good to open a file for writing if we actually want to write in it

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>