open (list-of-specifiers)À¸·Î ¸¹ÀÌ »ç¿ëÇÏ´Â ±ÔÁ¤ÀÚ(specifier)·Î´Â:
[UNIT=] u IOSTAT= ios ERR= err FILE= fname STATUS= sta ACCESS= acc FORM= frm RECL= rlµîÀÌ ÀÖ´Ù. ÀåÄ¡ ¹øÈ£ u ´Â fileÀ» ³ªÅ¸³»´Â 9¿¡¼ 99»çÀÌÀÇ ¼ýÀÚ Çϳª·Î ÇÁ·Î±×·¥ÇÏ´Â »ç¶÷ÀÌ ÀÓÀÇ·Î ÅÃÇÒ ¼ö ÀÖÁö¸¸ ´Ù¸¥ °÷¿¡¼´Â »ç¿ëÇÏ°í ÀÌÁö ¾Ê´Ù´Â °ÍÀ» ½º½º·Î È®ÀÎÇÏ¿©¾ßÇÑ´Ù.
ios ´Â ÀÔÃâ·Â »óÅ ǥ½Ã·Î Á¤¼ö º¯¼öÀÌ´Ù. ¸í·ÉÀÌ ¼º°øÀûÀ¸·Î ¼öÇàµÇ¾ú´Ù¸é ios°¡ 0ÀÌ°í ¾Æ´Ï¸é 0ÀÌ ¾Æ´Ï ¾î¶² °ªÀÌ µÈ´Ù.
err ´Â ¿À·ù°¡ ¹ß»ýÇϸé À̵¿ÇÒ ¹®Àå ¹øÈ£ÀÌ´Ù.
fname Àº fileÀ̸§À» ³ªÅ¸³»´Â ¹®ÀÚ¿ÀÌ´Ù.
sta´Â ¹®ÀÚ¿·Î NEW, OLD ¶Ç´Â SCRATCH ÁßÀÇ ÇϳªÀÌ´Ù. ÀÌ´Â fileÀÇ ÀÌÀü »óŸ¦ ³ªÅ¸³½´Ù. scrath fileÀº ¸¸µé¾îÁö°í fileÀÌ ´ÝÈ÷°Å³ª ÇÁ·Î±×·¥ÀÌ ³¡³ª¸é Áö¿öÁö´Â fileÀÌ´Ù.
acc ´Â SEQUENTIAL ¶Ç´Â DIRECTÀ̾î¾ß¸¸ ÇÑ´Ù. ¹Ì¸® ¼³Á¤ÇÑ °ªÀº SEQUENTIALÀÌ´Ù.
frm Àº FORMATTED ¶Ç´Â UNFORMATTEDÀÌ°í ¹Ì¸® ¼³Á¤ÇÑ °ªÀº UNFORMATTEDÀÌ´Ù.
rl Àº direct-access fileÀÇ recordÀÇ ±æÀ̸¦ ³ªÅ¸³½´Ù.
ÀÌ·± specifiers¿¡ ´ëÇÏ¿© ´õ ÀÚ¼¼È÷ ¾Ë°Å ½ÍÀ¸¸é Fortran 77 Ã¥À» ÂüÁ¶Ç϶ó.
fileÀ» ¿¬ µÚ¿¡ read ¶Ç´Â write ¸í·ÉÀ» »ç¿ëÇÑ´Ù. file¿¡ °üÇÑ ÀÏÀ» ´Ù ¸¶Ä¡¸é ´ÙÀ½ ¸í·ÉÀ» »ç¿ëÇÏ¿© ´Ý¾Æ¾ß ÇÑ´Ù.
close ([UNIT=]u[,IOSTAT=ios,ERR=err,STATUS=sta])¿©´Ì ¶§¿Í ¸¶Âù°¡Áö·Î ¿©±â¼ °ýÈ£ ¾ÈÀÇ º¯¼ö´Â ¼±ÅÃÀûÀÌ´Ù.
read ([UNIT=]u, [FMT=]fmt, IOSTAT=ios, ERR=err, END=s) write([UNIT=]u, [FMT=]fmt, IOSTAT=ios, ERR=err, END=s)´ëºÎºÐÀÇ ±ÔÁ¤ÀÚ´Â ¾Õ¿¡¼ »ìÆì º¸¾Ò´Ù. END=s´Â fileÀ» ³¡(end-of-file)¿¡ ´Ù´Ù¸£¸é À̵¿ÇÒ ¹®Àå ¹øÈ£¸¦ ³ªÅ¸³½´Ù.
program inpdat c c This program reads n points from a data file and stores them in c 3 arrays x, y, z. c integer nmax, u parameter (nmax=1000, u=20) real x(nmax), y(nmax), z(nmax) c Open the data file open (u, FILE='points.dat', STATUS='OLD') c Read the number of points read(u,*) n if (n.GT.nmax) then write(*,*) 'Error: n = ', n, 'is larger than nmax =', nmax goto 9999 endif c Loop over the data points do 10 i= 1, n read(u,100) x(i), y(i), z(i) 10 enddo 100 format (3(F10.4)) c Close the file close (u) c Now we should process the data somehow... c (missing part) 9999 stop end