[UP]


Manual Reference Pages  - get_tmp (3)

NAME

get_tmp(3f) - [M_io] Return the name of the scratch directory (LICENSE:PD)

CONTENTS

Synopsis
Description
Example
Author
License

SYNOPSIS

function get_tmp() result(tname)

     character(len=:),allocatable :: tname

DESCRIPTION

Return the name of the scratch directory set by the most common environment variables used to designate a scratch directory. $TMPDIR is the canonical environment variable in Unix and POSIX[1] to use to specify a temporary directory for scratch space. If $TMPDIR is not set, $TEMP, $TEMPDIR, and $TMP are examined in that order. If nothing is set "/tmp/" is returned. The returned value always ends in "/". No test is made that the directory exists or is writable.

EXAMPLE

Sample:

    program demo_get_tmp
    use M_io, only : get_tmp, uniq
    implicit none
    character(len=:),allocatable :: answer
       answer=get_tmp()
       write(*,*)’result is ’,answer
       answer=get_tmp()//uniq(’_scratch’,create=.false.)
       write(*,*)’the file ’,answer,’ was a good scratch file name, at least a moment ago’
    end program demo_get_tmp

Sample Results:

    result is /cygdrive/c/Users/JSU/AppData/Local/Temp/

AUTHOR

John S. Urban

LICENSE

Public Domain


get_tmp (3) March 11, 2021
Generated by manServer 1.08 from 9cbcd800-bd14-4fe4-8415-d609bf8270e1 using man macros.