www.icetips.com  Icetips Utilities Documentation 5/9/2015    

Core Class: GetTempFilename

Previous  Top  Next  


Prototype: (<String pPath>,<String pPrefix>),String

 

pPathOptional path.  If omitted the default Temp path will be used
pPrefixOptional prefix for the temp filename.

 

ReturnsReturns a unique temporary filename. 

 

This method creates a unique filename and returns the full path.  If the pPath is specified that path is used, otherwise it will return the temporary path.  Please note that this method CREATES the temporary file also.  This is done by the GetTempFileName api call to prevent the filename from being allocated to some other program.  If you do not intend to use the file, just need a filename, use Remove() to remove the file.

 

The filename returned is always a short filename.  Use LongPath() to get the Long filename for the returned filename.  If you run the app from the Clarion IDE it will pick up a different TEMP folder than if you run it independent of the IDE.  That is because the Clarion IDE is 16bit so it has a different enviornment setting than standard 32bit programs.

 

Example:

 

ITC  ITCoreClass

fn   CString(2049)

Code

fn = ITC.GetTempFileName()

Remove(fn! Remove the file.

Message('Filename: ' & LongPath(fn))

 

 

See also:

GetTempFolder

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/gettempfilename_core.htm