Secure temporary file: Difference between revisions

→‎{{header|Fortran}}: I suppose not everyone is familiar with fortran I/O unit numbers.
m (added a ;Task: (bold) header.)
(→‎{{header|Fortran}}: I suppose not everyone is familiar with fortran I/O unit numbers.)
Line 135:
 
=={{header|Fortran}}==
Supposing F is an integer variable, whose value might be 10. This is the I/O unit number, and would be used in READ(F,''etc.'' and WRITE(F,''etc.'' statements. <lang Fortran> OPEN (F,STATUS = 'SCRATCH') !Temporary disc storage.</lang>
Other attributes might be specified depending on the intended usage, but note that no file name is given. When the file is closed, its storage vanishes back to the file system.
 
Following the OPEN statement with <code>INQUIRE (F,NAME = FNAME); WRITE (6,*) FNAME</code> yields <code> C:\DOCUME~1\Nicky\LOCALS~1\Temp\FOR57.tmp</code> which is the DOS style short (8.3) file name for <code>C:\Documents and Settings\Nicky\Local Settings\Temp\FOR57.tmp</code> and the example's numerical value of 57 will be different on another run. Thus, the file could be interfered with, except that a file opened with WRITE access is exclusive-use, and there is no point in opening a SCRATCH file with READONLY (to allow sharing) because it cannot be a pre-existing disc file. However, the actual behaviour of a particular file system and compiler may or may not support such refinements as shared access as implied by non-standard keywords as READONLY, etc.
 
=={{header|Go}}==
1,220

edits