C Library Functions  - get_tmp (3)

NAME

get_tmp(3f) - [M_io:QUERY] 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/
    >
    > the file /cygdrive/c/Users/JSU/AppData/Local/Temp/_scratch
    > was a good scratch file name, at least a moment ago

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 get_tmp (3) July 22, 2023
Generated by manServer 1.08 from 766a0357-4488-44c5-9d5f-50e087843df5 using man macros.