User Tools

Site Tools


gettempfilename_create_a_temporary_filename_.htm
Navigation:  Advanced Topics > Clarion Language Utilities >====== GetTempFileName (Generate a temporary file) ====== Previous pageReturn to chapter overviewNext page

GETTEMPFILENAME( prefix, <;pathname> )

blk2blue.jpg

GETTEMPFILENAME Returns the name of a temporary file
prefix A string constant or variable naming the prefix (first three letters) of the temporary file. If blank, the default prefix used is '$$$'
pathname A string constant or variable naming the location of the temporary file. If omitted, the system TEMP or TMP directory path is used.

GETTEMPFILENAME is used to generate a temporary file. If the pathname specified is invalid, GETTEMPFILENAME returns an empty string.

NoteBox.jpg

Make sure to remove your temporary files that you create after use. The Windows system will not automatically remove these files.

To add support for this utility to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type:     STRING

Example:

!Note ## represents a random number assigned to the temporary file name

   message(GETTEMPFILENAME('bob','d:\help'))   !created 'bob##.tmp' in D:\help

   message(GETTEMPFILENAME(''))                !created '$$$##.tmp' in

                                               !C:\WINNT\TEMP (my TEMP path)

gettempfilename_create_a_temporary_filename_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1