Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>tempfile()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 TEMPFILE()
 Creates a file for temporary use
------------------------------------------------------------------------------
 Syntax

     TEMPFILE([<cDirectory>], [<cExtension>], [<nFileAttr>])
         --> cFileName

 Arguments

     <cDirectory>  Designates the drive and directory where the temporary
     file is to be created.  The default is the current drive/directory.

     <cExtension>  Designates the file extension for the file.  The
     default is no extension.

     <nFileAttr> Designates a file attribute for the file.  The default
     is the SETFCREATE() setting.

 Returns

     Returns the name of the temporary file.  If no file is created, the
     function returns a null string.

 Description

     If you only need a file for a short time and want to avoid conflicts
     with existing files, use TEMPFILE() to create a file with a unique name.
     Names created by TEMPFILE() use the system date and system time.  You
     can hide the file, if you specify an attribute.  Attributes are coded as
     follows:

     Table 7-24:  File Attribute Coding
     ------------------------------------------------------------------------
     Value   Symb. constants     Definition
     ------------------------------------------------------------------------
     0       FA_NORMAL
     1       FA_READONLY         READ ONLY
     2       FA_HIDDEN           HIDDEN (Hidden files)
     4       FA_SYSTEM           SYSTEM (System files)
     32      FA_ARCHIVE          ARCHIVE (Changed since last backup)
     ------------------------------------------------------------------------

 Notes

     .  The temporary file name is always 8 characters long and
        consists exclusively of numbers with a period, if no extension has
        been specified.  The file is created with a length of 0 bytes.

     .  A designated file attribute has precedence over a setting
        created with SETFCREATE().

 Examples

     .  Create a temporary file in the current drive and directory:

        cTempFile := TEMPFILE()

     .  Create a temporary file in the root directory of the E: drive:

        cTempFile := TEMPFILE("E:\")

     .  Create a temporary file with a .TMP extension and a HIDDEN
        attribute in the root directory of the A: drive:

        cTempFile := TEMPFILE("A:\", "TMP", 2)


See Also: SETFATTR() SETFCREATE()

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