$GETTEMPNAME (get temporary file name)
$GETTEMPNAME specifies the name of a temporary file that is managed by session.
The file with the file name specified with the $GETTEMPNAME embedded function is deleted when a logout, forcible logout, or a session-ending timeout occurs. When downloading a CSV file, by using a name specified by the $GETTEMPNAME embedded function, you can automatically delete the created file. When $GETTEMPNAME is used with the jamscript command, the file is deleted when the command ends.
If you wish to open the file being downloaded with a browser helper application, specify the file name extension assigned to the helper application.
Syntax
return-value=$GETTEMPNAME(unique-character-string)
Values
-
return-value
Specifies the name of the variable into which the acquired temporary file name is set.
-
unique-character-string
Specifies a character string that is unique within the session, either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
— |
ERROR |
— |
Script execution interrupted |
An invalid argument was specified, or an error other than the above occurred. |
Example
The following example uses the $GETTEMPNAME embedded function to acquire the name of a temporary file. As indicated under Execution result, the temporary file name is set automatically by Asset Console.
[SET_VALUE] FILENAME = $GETTEMPNAME('Sample.csv') MSG = 'FILENAME = ' + FILENAME $ECHO(MSG)
- Execution result:
-
FILENAME = csv/$$3FAE0F01000004EC0001$4$Sample.csv