|
Previous Top Next |
Prototype: | (<String pPath>,<String pPrefix>),String |
pPath | Optional path. If omitted the default Temp path will be used |
pPrefix | Optional prefix for the temp filename. |
Returns | Returns 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: