Source: http://www.formettic.be/Cours_chap2_web/Exercices_6bis_GestionFichiers.pdf