get_tmp(3f) - [M_io:QUERY] Return the name of the scratch directory (LICENSE:PD)
Synopsis
Description
Examples
Author
License
function get_tmp() result(tname)
character(len=:),allocatable :: tname
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.
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_tmpSample 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
John S. Urban
Public Domain
Nemo Release 3.1 | get_tmp (3) | February 23, 2025 |