Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Creates a name for a temporary file.

If a unique file name is generated, an empty file is created and the handle to it is released; otherwise, only a file name is generated.

 

Syntax

 

s = DIR_GetTempFileName(sPath, sPrefix [, uUnique] )

 

Returns

 

String.

 

Parameters

 

Name

Type

Optional

Meaning

sPath

String

No

The directory path for the file name

sPrefix

String

No

The prefix string.
The function uses up to the first three characters of this string as the prefix of the file name.

uUnique

Number

Yes

An unsigned integer to be used in creating the temporary file name

 

If uUnique is zero, the function attempts to form a unique file name using the current system time. If the file already exists, the number is increased by one and the functions tests if this file already exists. This continues until a unique filename is found; the function creates a file by that name and closes it. Note that the function does not attempt to verify the uniqueness of the file name when uUnique is nonzero.

 

Remarks

 

GUIDTXT$(GUID$) can return a global unique identifier that can be used as unique file name too.

 

Restrictions

 

See also

 

File Module,

 

https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamea

 

Examples

 

string sTemp = DIR_GetTempFileName("c:\""xxx", 42)

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software