[UP]


Manual Reference Pages  - scratch (7)

NAME

scratch(7f) - [FORTRAN:OPEN] where scratch files are typically written by OPEN(3f) (LICENSE:PD)

SYNOPSIS

open( .... status=’scratch’)

DESCRIPTION

Where files opened with status=’scratch’ are written is implementation-dependent. Often the file is unlinked so that it goes away unconditionally when the program starts, so in many *nix environments you cannot see the scratch file that is often used. So the compiler documentation should be referred to, but typically a scratch file is opened with a unique filename in one of the following directories:
o in the directory pointed to by the environment variable $TMPDIR, if defined.
o next directories pointed to by $TMP and $TEMP are used if the variables are defined.
o if none of the variables are defined, then the /tmp directory is typically used on *nix systems, and the current directory is often used on other systems.

This can be important if you are generating large scratch files, as you may want to specify they are created in a secure directory or on a high-speed server such as a Lustre file server or memory-resident file system. Consider

o Scratch files are often opened using the current permission mask (umask) combined with possible operating-system or kernel defaults and file-system-dependent attributes, so make sure scratch files are properly secure
o files are written in an area that you can write to and have sufficient space in
o that the scratch space provides optimal performance
o make sure the system cleans up properly when programs are aborted.

The behavior is very system-dependent.

EXAMPLE: System-dependent example:

    open(newunit=lun,status=’scratch’)
    inquire(unit=lun,file=filename)
    write(*,*)’filename=’,filename)
    end


scratch (7) March 11, 2021
Generated by manServer 1.08 from b9473dc7-403e-4904-8344-c39277a5d07e using man macros.