Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> tempfile() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    TEMPFILE()

Purpose:     Generate a temporary filename.

Syntax:      TEMPFILE( [ extension ] )

Arguments:   extension   - Optional character string indicating the file
                           extension to assign to the temporary filename.
                           Specify only the 1 to 3 character extension, do
                           not include the dot leader.  If more than three
                           characters are specified, only the first three
                           will be used.  If omitted or an invalid
                           argument is given, the default file extension
                           is ".TMP".

Returns:     A unique temporary filename or a null ("") if an error
             occurred.

Description: TEMPFILE() is a file function used to create a unique
             temporary file name.  This is most often used to create
             temporary index files, or other temporary storage files.

Notes:       This function is not 100% foolproof!  In a Network
             environment two workstations could conceivably acquire the
             same filename although it is HIGHLY UNLIKELY.  This function
             can be made very safe in a network if the optional extension
             is supplied and is unique to each workstation making the
             call.  For instance, if the network assigns workstation
             numbers, and the current workstation is assigned station
             number 1, then a temporary file extension could be passed to
             TEMPFILE() as "S1".  In this manner each workstation would be
             guaranteed a unique extension.

Example:     *-- build a temporary index file for a Query condition
             USE mydbf
             tempindex = TEMPFILE()
             condition = QUERY()
             pbox = SAYINBOX( "Building query index, please wait" )
             INDEX ON IF(&condition, "A", "Z") TO (tempindex)
             POPBOX(pbox)
             SEEK "A"
             DBEDIT()
             SET INDEX TO
             ERASE (tempindex)
             USE

Source:      RL_TEMPF.PRG

See also:    CHECKFILE(), FILEDATE(), FILESIZE(), FILETIME(), PICKFILE()

See Also: CHECKFILE() FILEDATE() FILESIZE() FILETIME() PICKFILE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson