02.05.2014 Views

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Destruction d’un fichier 139<br />

7.5 – Destruction d’un fichier<br />

L’instruction CLOSE admet le paramètre à mot-clé<br />

STATUS qui par défaut (pour un fichier non temporaire)<br />

prend la valeur KEEP permettant ainsi de conserver<br />

le fichier après fermeture. Si on désire le supprimer il<br />

suffira de préciser la valeur DELETE pour ce paramètre.<br />

real, dimension(100) :: tab<br />

integer ios<br />

OPEN( UNIT=1,<br />

&<br />

FILE="data_seq", &<br />

ACTION="read",<br />

&<br />

STATUS="old",<br />

&<br />

IOSTAT=ios )<br />

if ( ios /= 0 ) then ! Problème à l’ouverture<br />

...<br />

end if<br />

...<br />

if ( condition ) then<br />

CLOSE( UNIT=1, STATUS="delete" )<br />

else<br />

CLOSE( UNIT=1 )<br />

end if<br />

INSTITUT DU DÉVELOPPEMENT<br />

ET DES RESSOURCES<br />

EN INFORMATIQUE SCIENTIFIQUE<br />

Cours langage Fortran – 27 janvier 2006<br />

<strong>Patrick</strong> <strong>Corde</strong> et <strong>Anne</strong> <strong>Fouilloux</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!